fix: minor enhancements

This commit is contained in:
MohamedAliBouhaouala
2025-05-06 19:03:00 +01:00
committed by Mohamed Marrouchi
parent 5dcd36be98
commit 5d8befacdf
11 changed files with 51 additions and 37 deletions

View File

@@ -9,6 +9,7 @@
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import {
BadRequestException,
ConflictException,
MethodNotAllowedException,
NotFoundException,
} from '@nestjs/common';
@@ -278,7 +279,7 @@ describe('NlpEntityController', () => {
};
await expect(
nlpEntityController.updateOne(buitInEntityId!, updateNlpEntity),
).rejects.toThrow(MethodNotAllowedException);
).rejects.toThrow(ConflictException);
});
it('should update weight if entity is builtin and weight is provided', async () => {

View File

@@ -9,6 +9,7 @@
import {
BadRequestException,
Body,
ConflictException,
Controller,
Delete,
Get,
@@ -166,7 +167,7 @@ export class NlpEntityController extends BaseController<
updateNlpEntityDto.weight,
);
} else {
throw new MethodNotAllowedException(
throw new ConflictException(
`Cannot update builtin NLP Entity ${nlpEntity.name} except for weight`,
);
}