mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: minor enhancements
This commit is contained in:
committed by
Mohamed Marrouchi
parent
5dcd36be98
commit
5d8befacdf
@@ -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 () => {
|
||||
|
||||
@@ -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`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user