feat: return relation
This commit is contained in:
parent
f29e99f48b
commit
1581626880
1 changed files with 11 additions and 4 deletions
|
|
@ -383,6 +383,7 @@ export class BranchController extends Controller {
|
||||||
district: true,
|
district: true,
|
||||||
subDistrict: true,
|
subDistrict: true,
|
||||||
contact: true,
|
contact: true,
|
||||||
|
bank: true,
|
||||||
createdBy: true,
|
createdBy: true,
|
||||||
updatedBy: true,
|
updatedBy: true,
|
||||||
},
|
},
|
||||||
|
|
@ -505,7 +506,15 @@ export class BranchController extends Controller {
|
||||||
);
|
);
|
||||||
|
|
||||||
return await prisma.branch.update({
|
return await prisma.branch.update({
|
||||||
include: { province: true, district: true, subDistrict: true },
|
include: {
|
||||||
|
province: true,
|
||||||
|
district: true,
|
||||||
|
subDistrict: true,
|
||||||
|
contact: true,
|
||||||
|
bank: true,
|
||||||
|
createdBy: true,
|
||||||
|
updatedBy: true,
|
||||||
|
},
|
||||||
data: {
|
data: {
|
||||||
...rest,
|
...rest,
|
||||||
statusOrder: +(rest.status === "INACTIVE"),
|
statusOrder: +(rest.status === "INACTIVE"),
|
||||||
|
|
@ -515,9 +524,7 @@ export class BranchController extends Controller {
|
||||||
deleteMany:
|
deleteMany:
|
||||||
listDeleted.length > 0 ? { id: { in: listDeleted.map((v) => v.id) } } : undefined,
|
listDeleted.length > 0 ? { id: { in: listDeleted.map((v) => v.id) } } : undefined,
|
||||||
upsert: bank.map((v) => ({
|
upsert: bank.map((v) => ({
|
||||||
where: {
|
where: { id: v.id || "" },
|
||||||
id: v.id || "",
|
|
||||||
},
|
|
||||||
create: { ...v, id: undefined },
|
create: { ...v, id: undefined },
|
||||||
update: v,
|
update: v,
|
||||||
})),
|
})),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue