fix bug in user, employee, institution,requestList
This commit is contained in:
parent
116fa02bd9
commit
709c21082a
9 changed files with 230 additions and 17 deletions
|
|
@ -70,16 +70,16 @@ type EmployeeCreate = {
|
|||
|
||||
nrcNo?: string | null;
|
||||
|
||||
dateOfBirth: Date;
|
||||
dateOfBirth?: Date | null;
|
||||
gender: string;
|
||||
nationality: string;
|
||||
|
||||
namePrefix?: string | null;
|
||||
firstName: string;
|
||||
firstName?: string;
|
||||
firstNameEN: string;
|
||||
middleName?: string | null;
|
||||
middleNameEN?: string | null;
|
||||
lastName: string;
|
||||
lastName?: string;
|
||||
lastNameEN: string;
|
||||
|
||||
addressEN: string;
|
||||
|
|
@ -112,11 +112,11 @@ type EmployeeUpdate = {
|
|||
|
||||
namePrefix?: string | null;
|
||||
firstName?: string;
|
||||
firstNameEN?: string;
|
||||
firstNameEN: string;
|
||||
middleName?: string | null;
|
||||
middleNameEN?: string | null;
|
||||
lastName?: string;
|
||||
lastNameEN?: string;
|
||||
lastNameEN: string;
|
||||
|
||||
addressEN?: string;
|
||||
address?: string;
|
||||
|
|
@ -364,9 +364,10 @@ export class EmployeeController extends Controller {
|
|||
},
|
||||
}),
|
||||
]);
|
||||
if (body.provinceId !== province?.id) throw relationError("Province");
|
||||
if (body.districtId !== district?.id) throw relationError("District");
|
||||
if (body.subDistrictId !== subDistrict?.id) throw relationError("SubDistrict");
|
||||
if (!!body.provinceId && body.provinceId !== province?.id) throw relationError("Province");
|
||||
if (!!body.districtId && body.districtId !== district?.id) throw relationError("District");
|
||||
if (!!body.subDistrictId && body.subDistrictId !== subDistrict?.id)
|
||||
throw relationError("SubDistrict");
|
||||
if (!customerBranch) throw relationError("Customer Branch");
|
||||
|
||||
await permissionCheck(req.user, customerBranch.customer.registeredBranch);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue