diff --git a/src/controllers/04-product-group-controller.ts b/src/controllers/04-product-group-controller.ts index dfe3cd8..f1a4fe8 100644 --- a/src/controllers/04-product-group-controller.ts +++ b/src/controllers/04-product-group-controller.ts @@ -128,15 +128,13 @@ export class ProductGroup extends Controller { @Security("keycloak") async getProductGroupById(@Path() groupId: string) { const record = await prisma.productGroup.findFirst({ + include: { + registeredBranch: true, + }, where: { id: groupId }, }); - if (!record) - throw new HttpError( - HttpStatus.NOT_FOUND, - "Product group cannot be found.", - "productGroupNotFound", - ); + if (!record) throw notFoundError("Product Group"); return record; }