fix: error update on empty productGroupId
This commit is contained in:
parent
8cd393151e
commit
e6315a0687
1 changed files with 2 additions and 2 deletions
|
|
@ -202,8 +202,8 @@ export class ProductType extends Controller {
|
||||||
where: { id: typeId },
|
where: { id: typeId },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (productGroup?.status === "CREATED") {
|
if (body.productGroupId && productGroup?.status === "CREATED") {
|
||||||
await prisma.productGroup.update({
|
await prisma.productGroup.updateMany({
|
||||||
where: { id: body.productGroupId, status: Status.CREATED },
|
where: { id: body.productGroupId, status: Status.CREATED },
|
||||||
data: { status: Status.ACTIVE },
|
data: { status: Status.ACTIVE },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue