diff --git a/src/controllers/04-product-controller.ts b/src/controllers/04-product-controller.ts index c6ff1cd..6a44f3c 100644 --- a/src/controllers/04-product-controller.ts +++ b/src/controllers/04-product-controller.ts @@ -144,6 +144,12 @@ export class ProductController extends Controller { ? { OR: [ { productGroupId }, + { + shared: true, + productGroup: { + registeredBranch: { OR: permissionCondCompany(req.user) }, + }, + }, { productGroup: { shared: true, @@ -159,14 +165,8 @@ export class ProductController extends Controller { ? [] : [ { - shared: true, productGroup: { - registeredBranch: { OR: permissionCondCompany(req.user) }, - }, - }, - { - productGroup: { - shared: true, + id: productGroupId, registeredBranch: { OR: permissionCondCompany(req.user) }, }, },