refactor: user relation
This commit is contained in:
parent
a74d8b63b1
commit
2bd30b735d
21 changed files with 607 additions and 185 deletions
|
|
@ -173,8 +173,8 @@ export class ProductController extends Controller {
|
|||
...body,
|
||||
statusOrder: +(body.status === "INACTIVE"),
|
||||
code: `${body.code.toLocaleUpperCase()}${last.value.toString().padStart(3, "0")}`,
|
||||
createdBy: req.user.name,
|
||||
updatedBy: req.user.name,
|
||||
createdByUserId: req.user.sub,
|
||||
updatedByUserId: req.user.sub,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
@ -230,7 +230,7 @@ export class ProductController extends Controller {
|
|||
}
|
||||
|
||||
const record = await prisma.product.update({
|
||||
data: { ...body, statusOrder: +(body.status === "INACTIVE"), updatedBy: req.user.name },
|
||||
data: { ...body, statusOrder: +(body.status === "INACTIVE"), updatedByUserId: req.user.sub },
|
||||
where: { id: productId },
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue