fix: wrong table ref

This commit is contained in:
Methapon2001 2024-06-11 16:16:22 +07:00
parent ce9f5d89ac
commit 69edca97b5

View file

@ -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 },
});