diff --git a/src/controllers/branch-controller.ts b/src/controllers/branch-controller.ts index 84f29d1..055fbfa 100644 --- a/src/controllers/branch-controller.ts +++ b/src/controllers/branch-controller.ts @@ -535,7 +535,7 @@ export class BranchController extends Controller { subDistrict: true, createdBy: true, updatedBy: true, - user: { where: { id: req.user.sub } }, + user: { where: { userId: req.user.sub } }, }, where: { id: branchId }, }); diff --git a/src/controllers/product/product-controller.ts b/src/controllers/product/product-controller.ts index c2e6e88..cd309ca 100644 --- a/src/controllers/product/product-controller.ts +++ b/src/controllers/product/product-controller.ts @@ -200,7 +200,7 @@ export class ProductController extends Controller { where: { id: body.productTypeId }, }), prisma.branch.findFirst({ - include: { user: { where: { id: req.user.sub } } }, + include: { user: { where: { userId: req.user.sub } } }, where: { id: body.registeredBranchId }, }), ]); diff --git a/src/controllers/service/service-controller.ts b/src/controllers/service/service-controller.ts index 2946add..feb7627 100644 --- a/src/controllers/service/service-controller.ts +++ b/src/controllers/service/service-controller.ts @@ -244,7 +244,7 @@ export class ServiceController extends Controller { where: { id: body.productTypeId }, }), prisma.branch.findFirst({ - include: { user: { where: { id: req.user.sub } } }, + include: { user: { where: { userId: req.user.sub } } }, where: { id: body.registeredBranchId }, }), ]);