refactor: user relation
This commit is contained in:
parent
a74d8b63b1
commit
2bd30b735d
21 changed files with 607 additions and 185 deletions
|
|
@ -79,7 +79,7 @@ export class BranchContactController extends Controller {
|
|||
throw new HttpError(HttpStatus.BAD_REQUEST, "Branch cannot be found.", "branchBadReq");
|
||||
}
|
||||
const record = await prisma.branchContact.create({
|
||||
data: { ...body, branchId, createdBy: req.user.name, updatedBy: req.user.name },
|
||||
data: { ...body, branchId, createdByUserId: req.user.sub, updatedByUserId: req.user.sub },
|
||||
});
|
||||
|
||||
this.setStatus(HttpStatus.CREATED);
|
||||
|
|
@ -107,7 +107,7 @@ export class BranchContactController extends Controller {
|
|||
}
|
||||
|
||||
const record = await prisma.branchContact.update({
|
||||
data: { ...body, updatedBy: req.user.name },
|
||||
data: { ...body, updatedByUserId: req.user.sub },
|
||||
where: { id: contactId, branchId },
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue