From 0e9aa692a64f1ac6341f4ae55501a89fb59ac3eb Mon Sep 17 00:00:00 2001 From: Vins Date: Wed, 29 May 2024 09:33:38 +0200 Subject: [PATCH] Added office to customer creation --- src/app/api/notary/CustomersController.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/api/notary/CustomersController.ts b/src/app/api/notary/CustomersController.ts index 9de0192c..a6e1d159 100644 --- a/src/app/api/notary/CustomersController.ts +++ b/src/app/api/notary/CustomersController.ts @@ -60,6 +60,8 @@ export default class CustomersController extends ApiController { try { //init IUser resource with request body values const customerEntity = Customer.hydrate(req.body); + const officeId: string = req.body.user.office_Id; + customerEntity.office = { uid: officeId } as any; //validate user try { await validateOrReject(customerEntity, { groups: ["createCustomer"], forbidUnknownValues: false });