This commit is contained in:
Vincent Alamelle 2023-05-16 15:32:14 +02:00
parent 8441c06e9b
commit 941163822c
2 changed files with 7 additions and 2 deletions

View File

@ -51,7 +51,12 @@ export default class OfficeFoldersController extends ApiController {
const officeFolderNumberExist = await this.officeFoldersService.get({where: {folder_number: officeFolderRessource.folder_number}});
if (officeFolderNumberExist) {
this.httpValidationError(response, "Folder number already taken");
this.httpValidationError(response, [{
property: "folder_number",
constraints: {
unique: "folder_number must be unique",
},
}]);
return;
}

View File

@ -2,7 +2,7 @@ enum HttpCodes {
SUCCESS = 200,
CREATED = 201,
BAD_REQUEST = 400,
VALIDATION_ERROR = 422,
VALIDATION_ERROR = 409,
INTERNAL_ERROR = 500,
UNKNOWN_ERROR = 520,
NOT_IMPLEMENTED = 501,