diff --git a/src/app/api/admin/DeedTypesController.ts b/src/app/api/admin/DeedTypesController.ts index efa9d463..742d55b4 100644 --- a/src/app/api/admin/DeedTypesController.ts +++ b/src/app/api/admin/DeedTypesController.ts @@ -30,8 +30,9 @@ export default class DeedTypesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DeedTypesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const deedTypeEntities: DeedTypes[] = await this.deedTypesService.get(query); diff --git a/src/app/api/admin/DeedsController.ts b/src/app/api/admin/DeedsController.ts index 10da15b8..200c230f 100644 --- a/src/app/api/admin/DeedsController.ts +++ b/src/app/api/admin/DeedsController.ts @@ -30,8 +30,9 @@ export default class DeedsController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DeedsWhereInput = { deed_type: { office: { uid: officeId } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { deed_type : {office: officeWhereInput}}; + query.where.deed_type!.office = officeWhereInput; //call service to get prisma entity const deedEntities: Deeds[] = await this.deedsService.get(query); diff --git a/src/app/api/admin/DocumentTypesController.ts b/src/app/api/admin/DocumentTypesController.ts index 9d170efe..caf2ad33 100644 --- a/src/app/api/admin/DocumentTypesController.ts +++ b/src/app/api/admin/DocumentTypesController.ts @@ -30,8 +30,9 @@ export default class DocumentTypesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DocumentTypesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const documentTypeEntities: DocumentTypes[] = await this.documentTypesService.get(query); diff --git a/src/app/api/admin/DocumentsController.ts b/src/app/api/admin/DocumentsController.ts index 61c45686..4befe3f4 100644 --- a/src/app/api/admin/DocumentsController.ts +++ b/src/app/api/admin/DocumentsController.ts @@ -30,8 +30,9 @@ export default class DocumentsController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DocumentsWhereInput = { document_type: { office: { uid: officeId } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { document_type : {office: officeWhereInput}}; + query.where.document_type!.office = officeWhereInput; //call service to get prisma entity const documentEntities = await this.documentsService.get(query); diff --git a/src/app/api/admin/FilesController.ts b/src/app/api/admin/FilesController.ts index c7dab853..27e881b2 100644 --- a/src/app/api/admin/FilesController.ts +++ b/src/app/api/admin/FilesController.ts @@ -29,8 +29,9 @@ export default class FilesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.FilesWhereInput = { document: { folder: { office: { uid: officeId } } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { document: { folder: {office: officeWhereInput}}}; + query.where.document!.folder!.office = officeWhereInput; //call service to get prisma entity const fileEntities = await this.filesService.get(query); diff --git a/src/app/api/admin/OfficeFoldersController.ts b/src/app/api/admin/OfficeFoldersController.ts index 61130e69..0311e1fd 100644 --- a/src/app/api/admin/OfficeFoldersController.ts +++ b/src/app/api/admin/OfficeFoldersController.ts @@ -29,8 +29,10 @@ export default class OfficeFoldersController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.OfficeFoldersWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; + //call service to get prisma entity const officeFolderEntities: OfficeFolders[] = await this.officeFoldersService.get(query); diff --git a/src/app/api/admin/OfficeRolesController.ts b/src/app/api/admin/OfficeRolesController.ts index a8811e26..eb267dca 100644 --- a/src/app/api/admin/OfficeRolesController.ts +++ b/src/app/api/admin/OfficeRolesController.ts @@ -29,8 +29,9 @@ export default class OfficeRolesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.OfficeRolesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const officeRolesEntities = await this.officeRolesService.get(query); diff --git a/src/app/api/admin/UsersController.ts b/src/app/api/admin/UsersController.ts index 282820d8..707a8ccf 100644 --- a/src/app/api/admin/UsersController.ts +++ b/src/app/api/admin/UsersController.ts @@ -28,8 +28,9 @@ export default class UsersController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.UsersWhereInput = { office_membership: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office_membership: officeWhereInput}; + query.where.office_membership = officeWhereInput; //call service to get prisma entity const usersEntities = await this.usersService.get(query); diff --git a/src/app/api/notary/DeedTypesController.ts b/src/app/api/notary/DeedTypesController.ts index 549fb6c8..8c87de2a 100644 --- a/src/app/api/notary/DeedTypesController.ts +++ b/src/app/api/notary/DeedTypesController.ts @@ -30,8 +30,9 @@ export default class DeedTypesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DeedTypesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const deedTypeEntities: DeedTypes[] = await this.deedTypesService.get(query); diff --git a/src/app/api/notary/DeedsController.ts b/src/app/api/notary/DeedsController.ts index 45e08915..746c476e 100644 --- a/src/app/api/notary/DeedsController.ts +++ b/src/app/api/notary/DeedsController.ts @@ -30,8 +30,9 @@ export default class DeedsController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DeedsWhereInput = { deed_type: { office: { uid: officeId } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { deed_type : {office: officeWhereInput}}; + query.where.deed_type!.office = officeWhereInput; //call service to get prisma entity const deedEntities: Deeds[] = await this.deedsService.get(query); diff --git a/src/app/api/notary/DocumentTypesController.ts b/src/app/api/notary/DocumentTypesController.ts index 6bdbe117..7f55f97c 100644 --- a/src/app/api/notary/DocumentTypesController.ts +++ b/src/app/api/notary/DocumentTypesController.ts @@ -30,8 +30,9 @@ export default class DocumentTypesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DocumentTypesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const documentTypeEntities: DocumentTypes[] = await this.documentTypesService.get(query); diff --git a/src/app/api/notary/DocumentsController.ts b/src/app/api/notary/DocumentsController.ts index 41e53c10..35147482 100644 --- a/src/app/api/notary/DocumentsController.ts +++ b/src/app/api/notary/DocumentsController.ts @@ -30,8 +30,9 @@ export default class DocumentsController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DocumentsWhereInput = { document_type: { office: { uid: officeId } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { document_type : {office: officeWhereInput}}; + query.where.document_type!.office = officeWhereInput; //call service to get prisma entity const documentEntities = await this.documentsService.get(query); diff --git a/src/app/api/notary/FilesController.ts b/src/app/api/notary/FilesController.ts index fcd15ccd..009de81c 100644 --- a/src/app/api/notary/FilesController.ts +++ b/src/app/api/notary/FilesController.ts @@ -29,8 +29,9 @@ export default class FilesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.FilesWhereInput = { document: { folder: { office: { uid: officeId } } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { document: { folder: {office: officeWhereInput}}}; + query.where.document!.folder!.office = officeWhereInput; //call service to get prisma entity const fileEntities = await this.filesService.get(query); diff --git a/src/app/api/notary/OfficeFoldersController.ts b/src/app/api/notary/OfficeFoldersController.ts index 255540d7..6ab29975 100644 --- a/src/app/api/notary/OfficeFoldersController.ts +++ b/src/app/api/notary/OfficeFoldersController.ts @@ -29,8 +29,9 @@ export default class OfficeFoldersController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.OfficeFoldersWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const officeFolderEntities: OfficeFolders[] = await this.officeFoldersService.get(query); diff --git a/src/app/api/notary/OfficeRolesController.ts b/src/app/api/notary/OfficeRolesController.ts index 99c02cec..4d4128f0 100644 --- a/src/app/api/notary/OfficeRolesController.ts +++ b/src/app/api/notary/OfficeRolesController.ts @@ -28,8 +28,9 @@ export default class OfficeRolesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.OfficeRolesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const officeRolesEntities = await this.officeRolesService.get(query); diff --git a/src/app/api/notary/UsersController.ts b/src/app/api/notary/UsersController.ts index a3d74952..46683666 100644 --- a/src/app/api/notary/UsersController.ts +++ b/src/app/api/notary/UsersController.ts @@ -28,8 +28,9 @@ export default class UsersController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.UsersWhereInput = { office_membership: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office_membership: officeWhereInput}; + query.where.office_membership = officeWhereInput; //call service to get prisma entity const usersEntities = await this.usersService.get(query); diff --git a/src/app/api/super-admin/CustomersController.ts b/src/app/api/super-admin/CustomersController.ts index 271988ea..56c718b0 100644 --- a/src/app/api/super-admin/CustomersController.ts +++ b/src/app/api/super-admin/CustomersController.ts @@ -22,7 +22,7 @@ export default class CustomersController extends ApiController { protected async get(req: Request, response: Response) { try { //get query - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } @@ -120,7 +120,7 @@ export default class CustomersController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/DeedTypesController.ts b/src/app/api/super-admin/DeedTypesController.ts index 7eee309f..e2c8acba 100644 --- a/src/app/api/super-admin/DeedTypesController.ts +++ b/src/app/api/super-admin/DeedTypesController.ts @@ -30,8 +30,9 @@ export default class DeedTypesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DeedTypesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const deedTypeEntities: DeedTypes[] = await this.deedTypesService.get(query); @@ -131,7 +132,7 @@ export default class DeedTypesController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/DeedsController.ts b/src/app/api/super-admin/DeedsController.ts index d563acea..06e20d9d 100644 --- a/src/app/api/super-admin/DeedsController.ts +++ b/src/app/api/super-admin/DeedsController.ts @@ -30,8 +30,9 @@ export default class DeedsController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DeedsWhereInput = { deed_type: { office: { uid: officeId } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { deed_type : {office: officeWhereInput}}; + query.where.deed_type!.office = officeWhereInput; //call service to get prisma entity const deedEntities: Deeds[] = await this.deedsService.get(query); @@ -60,7 +61,7 @@ export default class DeedsController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/DocumentTypesController.ts b/src/app/api/super-admin/DocumentTypesController.ts index 353d6041..baceb4db 100644 --- a/src/app/api/super-admin/DocumentTypesController.ts +++ b/src/app/api/super-admin/DocumentTypesController.ts @@ -30,8 +30,9 @@ export default class DocumentTypesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DocumentTypesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const documentTypeEntities: DocumentTypes[] = await this.documentTypesService.get(query); @@ -125,7 +126,7 @@ export default class DocumentTypesController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/DocumentsController.ts b/src/app/api/super-admin/DocumentsController.ts index 317500b2..7ccdb18c 100644 --- a/src/app/api/super-admin/DocumentsController.ts +++ b/src/app/api/super-admin/DocumentsController.ts @@ -30,8 +30,9 @@ export default class DocumentsController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.DocumentsWhereInput = { document_type: { office: { uid: officeId } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { document_type : {office: officeWhereInput}}; + query.where.document_type!.office = officeWhereInput; //call service to get prisma entity const documentEntities = await this.documentsService.get(query); @@ -160,7 +161,7 @@ export default class DocumentsController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/FilesController.ts b/src/app/api/super-admin/FilesController.ts index ed2572b2..cf085d5f 100644 --- a/src/app/api/super-admin/FilesController.ts +++ b/src/app/api/super-admin/FilesController.ts @@ -29,8 +29,10 @@ export default class FilesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.FilesWhereInput = { document: { folder: { office: { uid: officeId } } } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { document: { folder: {office: officeWhereInput}}}; + query.where.document!.folder!.office = officeWhereInput; + //call service to get prisma entity const fileEntities = await this.filesService.get(query); @@ -123,7 +125,7 @@ export default class FilesController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/OfficeFoldersController.ts b/src/app/api/super-admin/OfficeFoldersController.ts index 73b74ceb..9e8278fd 100644 --- a/src/app/api/super-admin/OfficeFoldersController.ts +++ b/src/app/api/super-admin/OfficeFoldersController.ts @@ -29,8 +29,10 @@ export default class OfficeFoldersController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.OfficeFoldersWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; + //call service to get prisma entity const officeFolderEntities: OfficeFolders[] = await this.officeFoldersService.get(query); @@ -82,12 +84,7 @@ export default class OfficeFoldersController extends ApiController { return; } - let query = {}; - if (req.query["q"]) { - query = JSON.parse(req.query["q"] as string); - } - - const officeFolderFound = await this.officeFoldersService.getByUid(uid, query); + const officeFolderFound = await this.officeFoldersService.getByUid(uid); if (!officeFolderFound) { this.httpNotFoundRequest(response, "office folder not found"); @@ -129,7 +126,7 @@ export default class OfficeFoldersController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/OfficeRolesController.ts b/src/app/api/super-admin/OfficeRolesController.ts index e1e8cf58..021f05da 100644 --- a/src/app/api/super-admin/OfficeRolesController.ts +++ b/src/app/api/super-admin/OfficeRolesController.ts @@ -29,8 +29,9 @@ export default class OfficeRolesController extends ApiController { query = JSON.parse(req.query["q"] as string); } const officeId: string = req.body.user.office_Id; - const officeWhereInput: Prisma.OfficeRolesWhereInput = { office: { uid: officeId } }; - query.where = officeWhereInput; + const officeWhereInput: Prisma.OfficesWhereInput = { uid: officeId } ; + if(!query.where) query.where = { office: officeWhereInput}; + query.where.office = officeWhereInput; //call service to get prisma entity const officeRolesEntities = await this.officeRolesService.get(query); @@ -127,7 +128,7 @@ export default class OfficeRolesController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/OfficesController.ts b/src/app/api/super-admin/OfficesController.ts index 4803204c..d2c034b8 100644 --- a/src/app/api/super-admin/OfficesController.ts +++ b/src/app/api/super-admin/OfficesController.ts @@ -22,7 +22,7 @@ export default class OfficesController extends ApiController { protected async get(req: Request, response: Response) { try { //get query - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } @@ -107,7 +107,7 @@ export default class OfficesController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/RolesController.ts b/src/app/api/super-admin/RolesController.ts index f5f1924d..ba0683ab 100644 --- a/src/app/api/super-admin/RolesController.ts +++ b/src/app/api/super-admin/RolesController.ts @@ -22,7 +22,7 @@ export default class RolesController extends ApiController { protected async get(req: Request, response: Response) { try { //get query - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } @@ -122,7 +122,7 @@ export default class RolesController extends ApiController { return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/RulesController.ts b/src/app/api/super-admin/RulesController.ts index 09b0995d..c0bc87c1 100644 --- a/src/app/api/super-admin/RulesController.ts +++ b/src/app/api/super-admin/RulesController.ts @@ -22,7 +22,7 @@ export default class RulesController extends ApiController { protected async get(req: Request, response: Response) { try { //get query - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } @@ -121,7 +121,7 @@ export default class RulesController extends ApiController { this.httpBadRequest(response, "No uid provided"); return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/api/super-admin/UsersController.ts b/src/app/api/super-admin/UsersController.ts index b4b84a47..629add48 100644 --- a/src/app/api/super-admin/UsersController.ts +++ b/src/app/api/super-admin/UsersController.ts @@ -22,7 +22,7 @@ export default class UsersController extends ApiController { protected async get(req: Request, response: Response) { try { //get query - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } @@ -121,7 +121,7 @@ export default class UsersController extends ApiController { this.httpBadRequest(response, "No uid provided"); return; } - let query = {}; + let query; if (req.query["q"]) { query = JSON.parse(req.query["q"] as string); } diff --git a/src/app/middlewares/OfficeMembershipHandlers/FolderHandler.ts b/src/app/middlewares/OfficeMembershipHandlers/FolderHandler.ts index e63d8782..6c1ef63c 100644 --- a/src/app/middlewares/OfficeMembershipHandlers/FolderHandler.ts +++ b/src/app/middlewares/OfficeMembershipHandlers/FolderHandler.ts @@ -33,7 +33,7 @@ export default async function folderHandler(req: Request, response: Response, ne const officeFolderService = Container.get(OfficeFoldersService); - if (officeFolderNumber) { + if (officeFolderNumber && req.method == "POST") { const officeFoldersWithSameNumber = await officeFolderService.get({ where: { folder_number: officeFolderNumber, office: { uid: officeId } }, });