refactor: user relation

This commit is contained in:
Methapon2001 2024-07-01 13:24:02 +07:00
parent a74d8b63b1
commit 2bd30b735d
21 changed files with 607 additions and 185 deletions

View file

@ -286,8 +286,8 @@ export class BranchController extends Controller {
district: { connect: districtId ? { id: districtId } : undefined },
subDistrict: { connect: subDistrictId ? { id: subDistrictId } : undefined },
headOffice: { connect: headOfficeId ? { id: headOfficeId } : undefined },
createdBy: req.user.name,
updatedBy: req.user.name,
createdBy: { connect: { id: req.user.sub } },
updatedBy: { connect: { id: req.user.sub } },
},
});
},
@ -403,7 +403,7 @@ export class BranchController extends Controller {
connect: headOfficeId ? { id: headOfficeId } : undefined,
disconnect: headOfficeId === null || undefined,
},
updatedBy: req.user.name,
updatedBy: { connect: { id: req.user.sub } },
},
where: { id: branchId },
});