fix: wrong shared condition

This commit is contained in:
Methapon Metanipat 2024-11-13 15:18:00 +07:00
parent b2442a03c4
commit 100db9a6ca

View file

@ -144,6 +144,12 @@ export class ProductController extends Controller {
? { ? {
OR: [ OR: [
{ productGroupId }, { productGroupId },
{
shared: true,
productGroup: {
registeredBranch: { OR: permissionCondCompany(req.user) },
},
},
{ {
productGroup: { productGroup: {
shared: true, shared: true,
@ -159,14 +165,8 @@ export class ProductController extends Controller {
? [] ? []
: [ : [
{ {
shared: true,
productGroup: { productGroup: {
registeredBranch: { OR: permissionCondCompany(req.user) }, id: productGroupId,
},
},
{
productGroup: {
shared: true,
registeredBranch: { OR: permissionCondCompany(req.user) }, registeredBranch: { OR: permissionCondCompany(req.user) },
}, },
}, },