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

@ -143,8 +143,8 @@ export class ProductGroup extends Controller {
...body,
statusOrder: +(body.status === "INACTIVE"),
code: `G${last.value.toString().padStart(2, "0")}`,
createdBy: req.user.name,
updatedBy: req.user.name,
createdByUserId: req.user.sub,
updatedByUserId: req.user.sub,
},
});
},
@ -171,7 +171,7 @@ export class ProductGroup extends Controller {
}
const record = await prisma.productGroup.update({
data: { ...body, statusOrder: +(body.status === "INACTIVE"), updatedBy: req.user.name },
data: { ...body, statusOrder: +(body.status === "INACTIVE"), updatedByUserId: req.user.sub },
where: { id: groupId },
});