Compare commits

...
4 Commits
Author SHA1 Message Date
Gabriel Amorim 68e5534edb Merge pull request #115 from dadosfera/fix/recreate-input
FIX: recreating input getting id the right way
2022-07-06 11:54:42 -03:00
Gabriel Rosa 51c7bdfebf FIX: recreating input getting id the right way 2022-07-06 11:53:22 -03:00
Rodrigo Zamboni 9f6d2c7c9c Merge pull request #114 from dadosfera/feat/logs-lib
HOTFIX - FIX: delete info field before using it
2022-07-06 11:11:20 -03:00
rodrigo.zamboni 02955b99fe FIX: delete info field before using it 2022-07-06 11:06:52 -03:00
3 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ interface Cron {
}
export interface Info {
costumer_id: string;
customer_id: string;
user_id: string;
customer: string;
customer_tier: string;
+4 -5
View File
@@ -125,7 +125,7 @@ export class InputsController {
@Post(':id')
@ApiOkResponse({ type: Input })
async reCreate(@Param('id') id: string, @Body() input: CreateInputReq) {
if (!id) id = id;
if (!input.id) input.id = id;
this.logger.info(`POST /${id}`, 'ON RECREATE ROUTE');
const response = await this.inputService.reCreate(input);
@@ -162,12 +162,11 @@ export class InputsController {
async update(@Body() updateInputDto: UpdateInputRequest, @Param() params) {
const { id } = params;
const { info } = updateInputDto;
delete updateInputDto.info;
this.logger.info(`/input/${id} - ON UPDATE ROUTE`, {
user: updateInputDto.info.user_id,
customer: updateInputDto.info.costumer_id,
user: info.user_id,
customer: info.customer_id,
});
delete updateInputDto.info;
const response = await this.inputService.update(id, updateInputDto, info);
+1 -2
View File
@@ -93,12 +93,11 @@ export class OutputsController {
async update(@Payload() updateOutputDto, @Param() params) {
const { id } = params;
const { info } = updateOutputDto;
delete updateOutputDto.info;
this.logger.info(process.env.DEV_URL + `/output/${id} - ON UPDATE ROUTE`, {
user: updateOutputDto.info.user_id,
customer: updateOutputDto.info.customer,
});
delete updateOutputDto.info;
const outputService = new OutputsService(this.outputsClientService);
const response = await outputService.update(id, updateOutputDto, info);