Merge branch 'dev' into staging

This commit is contained in:
Vins 2024-11-04 10:45:23 +01:00
commit 69cd4911ed
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,7 @@ export default async function folderHandler(req: Request, response: Response, ne
const deed = req.body.deed; const deed = req.body.deed;
const folderNumber = req.body.folder_number; const folderNumber = req.body.folder_number;
const stakeHolders = req.body.stakeholders as any[]; const stakeHolders = req.body.stakeholders as any[];
const description = req.body.description;
if (office && office.uid != officeId) { if (office && office.uid != officeId) {
response.status(HttpCodes.UNAUTHORIZED).send("Unauthorized with this office"); response.status(HttpCodes.UNAUTHORIZED).send("Unauthorized with this office");
@ -31,6 +32,11 @@ export default async function folderHandler(req: Request, response: Response, ne
} }
} }
if (description && description.length > 250) {
response.status(HttpCodes.VALIDATION_ERROR).send([{ property: "description", constraints: { description: "La description dépasse 250 caractères" } }]);
return;
}
if (stakeHolders && stakeHolders.length === 0) { if (stakeHolders && stakeHolders.length === 0) {
response response
.status(HttpCodes.VALIDATION_ERROR) .status(HttpCodes.VALIDATION_ERROR)

View File

@ -407,6 +407,8 @@ export default class IdNotService extends BaseService {
return null; return null;
} }
console.log("officeLocationData", officeLocationData);
const office = await this.officeService.get({ where: { idNot: decodedToken.entity_idn } }); const office = await this.officeService.get({ where: { idNot: decodedToken.entity_idn } });
// if(officeLocationData.result[0]!.adrGeoCodePostal.slice(0,2) !== "35") { // if(officeLocationData.result[0]!.adrGeoCodePostal.slice(0,2) !== "35") {