feat: add order field

This commit is contained in:
Methapon2001 2024-06-24 13:14:44 +07:00
parent aa8dcdaf86
commit 0bd2c1ecf2
11 changed files with 79 additions and 26 deletions

View file

@ -279,6 +279,7 @@ export class BranchController extends Controller {
},
data: {
...rest,
statusOrder: +(rest.status === "INACTIVE"),
code,
isHeadOffice: !headOfficeId,
province: { connect: provinceId ? { id: provinceId } : undefined },
@ -384,6 +385,7 @@ export class BranchController extends Controller {
include: { province: true, district: true, subDistrict: true },
data: {
...rest,
statusOrder: +(rest.status === "INACTIVE"),
isHeadOffice: headOfficeId !== undefined ? headOfficeId === null : undefined,
province: {
connect: provinceId ? { id: provinceId } : undefined,