refactor(api): Refactor updateOne logic

This commit is contained in:
yassinedorbozgithub
2025-01-16 18:47:25 +01:00
parent 47e8056a15
commit 6c75e6df4a
35 changed files with 92 additions and 164 deletions

View File

@@ -167,17 +167,7 @@ export class NlpEntityController extends BaseController<
);
}
const result = await this.nlpEntityService.updateOne(
id,
updateNlpEntityDto,
);
if (!result) {
this.logger.warn(`Failed to update NLP Entity by id ${id}`);
throw new InternalServerErrorException(
`Failed to update NLP Entity with ID ${id}`,
);
}
return result;
return await this.nlpEntityService.updateOne(id, updateNlpEntityDto);
}
/**