FIX: recreating input getting id the right way

This commit is contained in:
Gabriel Rosa
2022-07-06 11:53:22 -03:00
parent 9f6d2c7c9c
commit 51c7bdfebf
2 changed files with 4 additions and 4 deletions
+3 -3
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);
@@ -163,8 +163,8 @@ export class InputsController {
const { id } = params;
const { info } = updateInputDto;
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;