mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-14 00:59:09 +00:00
Prepared Outputs and Transformations to use info params given by auth
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { Payload } from '@nestjs/microservices';
|
||||
import { TransformationsClientService } from 'src/clients/transformations/client.service';
|
||||
import { IIdRequest } from 'src/clients/transformations/interfaces';
|
||||
import { TransformationsService } from './transformations.service';
|
||||
|
||||
@Controller('transformations')
|
||||
@@ -32,19 +33,19 @@ export class TransformationsController {
|
||||
}
|
||||
|
||||
@Get()
|
||||
async findAll() {
|
||||
async findAll(@Body() data: IIdRequest) {
|
||||
console.log(process.env.DEV_URL + `/transformation`, 'ON Find All ROUTE');
|
||||
|
||||
const transformationService = new TransformationsService(
|
||||
this.transformationsClientService,
|
||||
);
|
||||
const response = await transformationService.findAll();
|
||||
const response = await transformationService.findAll(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Get('/:id')
|
||||
async findOne(@Param() params) {
|
||||
async findOne(@Body() data, @Param() params) {
|
||||
const { id } = params;
|
||||
console.log(
|
||||
process.env.DEV_URL + `/transformation/${id}`,
|
||||
@@ -54,7 +55,7 @@ export class TransformationsController {
|
||||
const transformationService = new TransformationsService(
|
||||
this.transformationsClientService,
|
||||
);
|
||||
const response = await transformationService.findOne(id);
|
||||
const response = await transformationService.findOne({ id, ...data });
|
||||
|
||||
return response;
|
||||
}
|
||||
@@ -79,7 +80,7 @@ export class TransformationsController {
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param() params) {
|
||||
async delete(@Body() data, @Param() params) {
|
||||
const { id } = params;
|
||||
console.log(
|
||||
process.env.DEV_URL + `/transformation/${id}`,
|
||||
@@ -89,7 +90,7 @@ export class TransformationsController {
|
||||
const transformationService = new TransformationsService(
|
||||
this.transformationsClientService,
|
||||
);
|
||||
const response = await transformationService.remove(id);
|
||||
const response = await transformationService.remove({ id, ...data });
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user