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: [
{ 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) },
},
},