feat: add user relation on query

This commit is contained in:
Methapon2001 2024-07-01 14:38:07 +07:00
parent 2bd30b735d
commit 9f3b8cd290
14 changed files with 259 additions and 41 deletions

View file

@ -173,6 +173,8 @@ export class BranchController extends Controller {
subDistrict: true,
},
},
createdBy: true,
updatedBy: true,
},
where,
take: pageSize,
@ -195,6 +197,8 @@ export class BranchController extends Controller {
province: true,
district: true,
subDistrict: true,
createdBy: true,
updatedBy: true,
branch: includeSubBranch && {
include: {
province: true,
@ -276,6 +280,8 @@ export class BranchController extends Controller {
province: true,
district: true,
subDistrict: true,
createdBy: true,
updatedBy: true,
},
data: {
...rest,
@ -442,6 +448,8 @@ export class BranchController extends Controller {
province: true,
district: true,
subDistrict: true,
createdBy: true,
updatedBy: true,
},
where: { id: branchId },
});
@ -466,6 +474,8 @@ export class BranchController extends Controller {
province: true,
district: true,
subDistrict: true,
createdBy: true,
updatedBy: true,
},
where: { id: branchId },
});