feat: update status on used

This commit is contained in:
Methapon2001 2024-06-18 09:19:35 +07:00
parent 4d63ede738
commit b423f3b356

View file

@ -117,6 +117,13 @@ export class ProductType extends Controller {
{ isolationLevel: Prisma.TransactionIsolationLevel.Serializable },
);
if (productGroup.status === "CREATED") {
await prisma.productGroup.update({
where: { id: body.productGroupId },
data: { status: Status.ACTIVE },
});
}
this.setStatus(HttpStatus.CREATED);
return record;