fix: wrong table ref
This commit is contained in:
parent
ce9f5d89ac
commit
69edca97b5
1 changed files with 2 additions and 2 deletions
|
|
@ -99,11 +99,11 @@ export class ProductGroup extends Controller {
|
||||||
@Body() body: ProductGroupUpdate,
|
@Body() body: ProductGroupUpdate,
|
||||||
@Path() groupId: string,
|
@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");
|
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 },
|
data: { ...body, updateBy: req.user.name },
|
||||||
where: { id: groupId },
|
where: { id: groupId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue