From 69edca97b577949c6740bfe0c168b956c3a894e5 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:16:22 +0700 Subject: [PATCH] fix: wrong table ref --- src/controllers/product/group-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/product/group-controller.ts b/src/controllers/product/group-controller.ts index fb6ace0..ae3667a 100644 --- a/src/controllers/product/group-controller.ts +++ b/src/controllers/product/group-controller.ts @@ -99,11 +99,11 @@ export class ProductGroup extends Controller { @Body() body: ProductGroupUpdate, @Path() groupId: string, ) { - if (!(await prisma.work.findUnique({ where: { id: groupId } }))) { + if (!(await prisma.productGroup.findUnique({ where: { id: groupId } }))) { throw new HttpError(HttpStatus.NOT_FOUND, "Product group cannot be found.", "data_not_found"); } - const record = await prisma.work.update({ + const record = await prisma.productGroup.update({ data: { ...body, updateBy: req.user.name }, where: { id: groupId }, });