add checks on office controller
This commit is contained in:
parent
99985590bc
commit
73fb1b2625
@ -30,6 +30,13 @@ export default class OfficesController extends ApiController {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(query.where?.office_folders) delete query.where.office_folders;
|
||||
if(query.include?.office_folders) {
|
||||
this.httpForbidden(response, "You can't include office_folders");
|
||||
return;
|
||||
};
|
||||
|
||||
//call service to get prisma entity
|
||||
const officesEntities: Offices[] = await this.officesService.get(query);
|
||||
//Hydrate ressource with prisma entity
|
||||
|
@ -29,6 +29,12 @@ export default class OfficesController extends ApiController {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(query.where?.office_folders) delete query.where.office_folders;
|
||||
if(query.include?.office_folders) {
|
||||
this.httpForbidden(response, "You can't include office_folders");
|
||||
return;
|
||||
};
|
||||
//call service to get prisma entity
|
||||
const officesEntities: Offices[] = await this.officesService.get(query);
|
||||
//Hydrate ressource with prisma entity
|
||||
@ -56,6 +62,10 @@ export default class OfficesController extends ApiController {
|
||||
let query;
|
||||
if (req.query["q"]) {
|
||||
query = JSON.parse(req.query["q"] as string);
|
||||
if(query.office_folders) {
|
||||
this.httpForbidden(response, "You can't include office_folders");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const officeEntity = await this.officesService.getByUid(uid, query);
|
||||
|
@ -44,6 +44,12 @@ export default class OfficesController extends ApiController {
|
||||
}
|
||||
}
|
||||
|
||||
if(query.where?.office_folders) delete query.where.office_folders;
|
||||
if(query.include?.office_folders) {
|
||||
this.httpForbidden(response, "You can't include office_folders");
|
||||
return;
|
||||
};
|
||||
|
||||
//call service to get prisma entity
|
||||
const officesEntities: Offices[] = await this.officesService.get(query);
|
||||
//Hydrate ressource with prisma entity
|
||||
|
Loading…
x
Reference in New Issue
Block a user