changed forbidUknowValue

This commit is contained in:
Vincent Alamelle 2023-05-04 14:38:34 +02:00
parent 570a789653
commit cd654641fb

View File

@ -46,7 +46,7 @@ export default class OfficeFoldersController extends ApiController {
const officeFolderEntity = OfficeFolder.hydrate<OfficeFolder>(req.body); const officeFolderEntity = OfficeFolder.hydrate<OfficeFolder>(req.body);
//validate folder //validate folder
await validateOrReject(officeFolderEntity, { groups: ["createFolder"] , forbidUnknownValues:false}); await validateOrReject(officeFolderEntity, { groups: ["createFolder"] , forbidUnknownValues: false });
//call service to get prisma entity //call service to get prisma entity
const prismaEntityCreated = await this.officeFoldersService.create(officeFolderEntity); const prismaEntityCreated = await this.officeFoldersService.create(officeFolderEntity);
//Hydrate ressource with prisma entity //Hydrate ressource with prisma entity
@ -75,7 +75,7 @@ export default class OfficeFoldersController extends ApiController {
const officeFolderEntity = OfficeFolder.hydrate<OfficeFolder>(req.body); const officeFolderEntity = OfficeFolder.hydrate<OfficeFolder>(req.body);
//validate folder //validate folder
await validateOrReject(officeFolderEntity, { groups: ["updateFolder"], forbidUnknownValues: false }); await validateOrReject(officeFolderEntity, { groups: ["updateFolder"] });
//call service to get prisma entity //call service to get prisma entity
const prismaEntityUpdated = await this.officeFoldersService.update(uid, officeFolderEntity); const prismaEntityUpdated = await this.officeFoldersService.update(uid, officeFolderEntity);