mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-14 04:59:09 +00:00
REFACTOR: Att Functions + Alpha Clients connection
This commit is contained in:
@@ -16,7 +16,8 @@ import {
|
||||
} from '@nestjs/microservices';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { TransformationsServiceInterface } from '@victorradael/protospack';
|
||||
import { ICreateTransformationElement, ICreateTransformationsRequest, IdRequest, IUpdateTransformationRequest } from './interfaces';
|
||||
import { objectCamelToSnake } from 'src/utils/CaseConverter';
|
||||
import { Transformation, ICreateTransformationsRequest, IdRequest, IUpdateTransformationRequest } from './interfaces';
|
||||
|
||||
@Controller('transformation')
|
||||
export class TransformationsClientService implements OnModuleInit {
|
||||
@@ -54,7 +55,12 @@ export class TransformationsClientService implements OnModuleInit {
|
||||
.catch((err) => {
|
||||
throw new Error(err);
|
||||
});
|
||||
return createTransformationResponse;
|
||||
|
||||
const convertedTransforms = createTransformationResponse["transformations"].map((tr)=>{
|
||||
return objectCamelToSnake(tr)
|
||||
})
|
||||
|
||||
return {transformations:convertedTransforms};
|
||||
}
|
||||
|
||||
async findAll() {
|
||||
@@ -78,8 +84,10 @@ export class TransformationsClientService implements OnModuleInit {
|
||||
.catch((err) => {
|
||||
throw new Error(err);
|
||||
});
|
||||
|
||||
return findAllTransformationResponse;
|
||||
const convertedTransforms = findAllTransformationResponse["transformations"].map((tr)=>{
|
||||
return objectCamelToSnake(tr)
|
||||
})
|
||||
return {transformations:convertedTransforms};
|
||||
}
|
||||
|
||||
async findOne({id}: IdRequest) {
|
||||
@@ -104,7 +112,7 @@ export class TransformationsClientService implements OnModuleInit {
|
||||
throw new Error(err);
|
||||
});
|
||||
|
||||
return findOneTransformationResponse;
|
||||
return objectCamelToSnake(findOneTransformationResponse);
|
||||
}
|
||||
|
||||
async update(updateTransformationDTO: IUpdateTransformationRequest) {
|
||||
@@ -129,7 +137,7 @@ export class TransformationsClientService implements OnModuleInit {
|
||||
throw new Error(err);
|
||||
});
|
||||
|
||||
return updateTransformationResponse;
|
||||
return objectCamelToSnake(updateTransformationResponse);
|
||||
}
|
||||
|
||||
async remove({id}: IdRequest) {
|
||||
@@ -154,6 +162,6 @@ export class TransformationsClientService implements OnModuleInit {
|
||||
throw new Error(err);
|
||||
});
|
||||
|
||||
return removeTransformationResponse;
|
||||
return objectCamelToSnake(removeTransformationResponse);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user