mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-13 03:59:09 +00:00
preparing info param
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||
import { InputsClientService } from 'src/clients/inputs/client.service';
|
||||
import { IIdRequest, Info } from 'src/clients/inputs/interfaces';
|
||||
|
||||
@Injectable()
|
||||
export class InputsService {
|
||||
@@ -15,9 +16,9 @@ export class InputsService {
|
||||
}
|
||||
}
|
||||
|
||||
async findAll() {
|
||||
async findAll(info: Info) {
|
||||
try {
|
||||
const findAllInputResponse = await this.inputClient.findAll({});
|
||||
const findAllInputResponse = await this.inputClient.findAll(info);
|
||||
|
||||
return findAllInputResponse;
|
||||
} catch (err) {
|
||||
@@ -25,19 +26,20 @@ export class InputsService {
|
||||
}
|
||||
}
|
||||
|
||||
async findOne(id: string) {
|
||||
async findOne(idRequest: IIdRequest) {
|
||||
try {
|
||||
const findOneInputResponse = await this.inputClient.findOne({ id });
|
||||
const findOneInputResponse = await this.inputClient.findOne(idRequest);
|
||||
return findOneInputResponse;
|
||||
} catch (err) {
|
||||
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
async update(id: string, data) {
|
||||
async update(id: string, data, info: Info) {
|
||||
try {
|
||||
const updateInputResponse = await this.inputClient.update({
|
||||
id,
|
||||
info,
|
||||
...data,
|
||||
});
|
||||
|
||||
@@ -47,9 +49,9 @@ export class InputsService {
|
||||
}
|
||||
}
|
||||
|
||||
async remove(id: string) {
|
||||
async remove(idRequest: IIdRequest) {
|
||||
try {
|
||||
const removeInputResponse = await this.inputClient.remove({ id });
|
||||
const removeInputResponse = await this.inputClient.remove(idRequest);
|
||||
|
||||
return removeInputResponse;
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user