fix: update nlp value controller

This commit is contained in:
yassinedorbozgithub 2025-01-15 10:43:01 +01:00
parent b4006f591c
commit 630191c334

View File

@ -168,10 +168,7 @@ export class NlpValueController extends BaseController<
@Param('id') id: string,
@Body() updateNlpValueDto: NlpValueUpdateDto,
): Promise<NlpValue> {
const result = await this.nlpValueService.updateOne(id, {
...updateNlpValueDto,
entity: updateNlpValueDto.entity || undefined,
});
const result = await this.nlpValueService.updateOne(id, updateNlpValueDto);
if (!result) {
this.logger.warn(`Unable to update NLP Value by id ${id}`);
throw new NotFoundException(`NLP Value with ID ${id} not found`);