แก้ไข api สร้างโครงสร้าง
This commit is contained in:
parent
a1226bfbfc
commit
49c468f53d
2 changed files with 281 additions and 127 deletions
|
|
@ -57,18 +57,18 @@ export class OrgChild1Controller {
|
|||
}
|
||||
try {
|
||||
const getOrgChild1 = {
|
||||
"orgChild1Id" : orgChild1.id,
|
||||
"orgChild1Name" : orgChild1.orgChild1Name,
|
||||
"orgChild1ShortName" : orgChild1.orgChild1ShortName,
|
||||
"orgChild1Code" : orgChild1.orgChild1Code,
|
||||
"orgChild1Rank" : orgChild1.orgChild1Rank,
|
||||
"orgChild1Order" : orgChild1.orgChild1Order,
|
||||
"orgChild1PhoneEx" : orgChild1.orgChild1PhoneEx,
|
||||
"orgChild1PhoneIn" : orgChild1.orgChild1PhoneIn,
|
||||
"orgChild1Fax" : orgChild1.orgChild1Fax,
|
||||
"orgRevisionId" : orgChild1.orgRevisionId,
|
||||
"orgCode" : orgRoot.orgRootCode + orgChild1.orgChild1Code
|
||||
}
|
||||
orgChild1Id: orgChild1.id,
|
||||
orgChild1Name: orgChild1.orgChild1Name,
|
||||
orgChild1ShortName: orgChild1.orgChild1ShortName,
|
||||
orgChild1Code: orgChild1.orgChild1Code,
|
||||
orgChild1Rank: orgChild1.orgChild1Rank,
|
||||
orgChild1Order: orgChild1.orgChild1Order,
|
||||
orgChild1PhoneEx: orgChild1.orgChild1PhoneEx,
|
||||
orgChild1PhoneIn: orgChild1.orgChild1PhoneIn,
|
||||
orgChild1Fax: orgChild1.orgChild1Fax,
|
||||
orgRevisionId: orgChild1.orgRevisionId,
|
||||
orgCode: orgRoot.orgRootCode + orgChild1.orgChild1Code,
|
||||
};
|
||||
return new HttpSuccess(getOrgChild1);
|
||||
} catch (error) {
|
||||
return error;
|
||||
|
|
@ -85,8 +85,7 @@ export class OrgChild1Controller {
|
|||
async save(
|
||||
@Body() requestBody: CreateOrgChild1,
|
||||
@Request() request: { user: Record<string, any> },
|
||||
){
|
||||
|
||||
) {
|
||||
const rootIdExits = await this.orgRootRepository.findOne({
|
||||
where: { id: requestBody.orgRootId },
|
||||
});
|
||||
|
|
@ -94,13 +93,19 @@ export class OrgChild1Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRootId");
|
||||
}
|
||||
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
||||
where: { id: rootIdExits.orgRevisionId }
|
||||
where: { id: rootIdExits.orgRevisionId },
|
||||
});
|
||||
if (!revisionIdExits) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. RevisionId");
|
||||
}
|
||||
if(revisionIdExits.orgRevisionIsDraft != true && revisionIdExits.orgRevisionIsCurrent != false){
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRevisionIsDraft:true, orgRevisionIsCurrent:false");
|
||||
if (
|
||||
revisionIdExits.orgRevisionIsDraft != true &&
|
||||
revisionIdExits.orgRevisionIsCurrent != false
|
||||
) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"not found. orgRevisionIsDraft:true, orgRevisionIsCurrent:false",
|
||||
);
|
||||
}
|
||||
|
||||
const validOrgChild1Ranks = ["OFFICE", "DIVISION", "SECTION"];
|
||||
|
|
@ -109,13 +114,14 @@ export class OrgChild1Controller {
|
|||
}
|
||||
|
||||
const chkCode = await this.child1Repository.findOne({
|
||||
where: { orgRootId: requestBody.orgRootId, orgChild1Code: requestBody.orgChild1Code },
|
||||
where: {
|
||||
orgRevisionId: rootIdExits.orgRevisionId,
|
||||
orgRootId: requestBody.orgRootId,
|
||||
orgChild1Code: requestBody.orgChild1Code,
|
||||
},
|
||||
});
|
||||
if (chkCode != null) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||
"รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว",
|
||||
);
|
||||
throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "รหัสหน่วยงานนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
try {
|
||||
const child1 = Object.assign(new OrgChild1(), requestBody) as OrgChild1;
|
||||
|
|
@ -158,8 +164,14 @@ export class OrgChild1Controller {
|
|||
if (!revisionIdExits) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. RevisionId");
|
||||
}
|
||||
if(revisionIdExits.orgRevisionIsDraft != true && revisionIdExits.orgRevisionIsCurrent != false){
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRevisionIsDraft:true, orgRevisionIsCurrent:false");
|
||||
if (
|
||||
revisionIdExits.orgRevisionIsDraft != true &&
|
||||
revisionIdExits.orgRevisionIsCurrent != false
|
||||
) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"not found. orgRevisionIsDraft:true, orgRevisionIsCurrent:false",
|
||||
);
|
||||
}
|
||||
|
||||
const validOrgChild1Ranks = ["OFFICE", "DIVISION", "SECTION"];
|
||||
|
|
@ -177,6 +189,7 @@ export class OrgChild1Controller {
|
|||
const chkCode = await this.child1Repository.findOne({
|
||||
where: {
|
||||
id: Not(id),
|
||||
orgRevisionId: rootIdExits.orgRevisionId,
|
||||
orgRootId: requestBody.orgRootId,
|
||||
orgChild1Code: requestBody.orgChild1Code,
|
||||
},
|
||||
|
|
@ -217,8 +230,14 @@ export class OrgChild1Controller {
|
|||
if (!revisionIdExits) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. RevisionId");
|
||||
}
|
||||
if(revisionIdExits.orgRevisionIsDraft != true && revisionIdExits.orgRevisionIsCurrent != false){
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRevisionIsDraft:true, orgRevisionIsCurrent:false");
|
||||
if (
|
||||
revisionIdExits.orgRevisionIsDraft != true &&
|
||||
revisionIdExits.orgRevisionIsCurrent != false
|
||||
) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"not found. orgRevisionIsDraft:true, orgRevisionIsCurrent:false",
|
||||
);
|
||||
}
|
||||
const exitsChild2 = await this.child2Repository.findOne({ where: { orgChild1Id: id } });
|
||||
if (exitsChild2) {
|
||||
|
|
|
|||
|
|
@ -149,6 +149,20 @@ export class OrganizationController extends Controller {
|
|||
await this.orgRootRepository.save(_orgRoot);
|
||||
|
||||
_orgRoot.forEach(async (x: any) => {
|
||||
var dataId = x.id;
|
||||
//clone data
|
||||
const orgChild1 = await this.child1Repository.find({
|
||||
where: { orgRootId: dataId, orgRevisionId: requestBody.orgRevisionId },
|
||||
});
|
||||
const _orgChild1 = orgChild1.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child1Repository.save(_orgChild1);
|
||||
|
||||
delete x.id;
|
||||
const data = Object.assign(new OrgRoot(), x);
|
||||
data.orgRevisionId = revision.id;
|
||||
|
|
@ -159,107 +173,228 @@ export class OrganizationController extends Controller {
|
|||
data.lastUpdateFullName = request.user.name;
|
||||
data.lastUpdatedAt = new Date();
|
||||
await this.orgRootRepository.save(data);
|
||||
});
|
||||
//clone data
|
||||
const orgChild1 = await this.child1Repository.find({
|
||||
where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
});
|
||||
const _orgChild1 = orgChild1.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child1Repository.save(_orgChild1);
|
||||
|
||||
_orgChild1.forEach(async (x: any) => {
|
||||
delete x.id;
|
||||
const data = Object.assign(new OrgChild1(), x);
|
||||
data.orgRevisionId = revision.id;
|
||||
data.createdUserId = request.user.sub;
|
||||
data.createdFullName = request.user.name;
|
||||
data.createdAt = new Date();
|
||||
data.lastUpdateUserId = request.user.sub;
|
||||
data.lastUpdateFullName = request.user.name;
|
||||
data.lastUpdatedAt = new Date();
|
||||
await this.child1Repository.save(data);
|
||||
});
|
||||
//clone data
|
||||
const orgChild2 = await this.child2Repository.find({
|
||||
where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
});
|
||||
const _orgChild2 = orgChild2.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child2Repository.save(_orgChild2);
|
||||
_orgChild1.forEach(async (x: any) => {
|
||||
var data1Id = x.id;
|
||||
//clone data
|
||||
const orgChild2 = await this.child2Repository.find({
|
||||
where: {
|
||||
orgRootId: dataId,
|
||||
orgChild1Id: data1Id,
|
||||
orgRevisionId: requestBody.orgRevisionId,
|
||||
},
|
||||
});
|
||||
const _orgChild2 = orgChild2.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child2Repository.save(_orgChild2);
|
||||
|
||||
_orgChild2.forEach(async (x: any) => {
|
||||
delete x.id;
|
||||
const data = Object.assign(new OrgChild2(), x);
|
||||
data.orgRevisionId = revision.id;
|
||||
data.createdUserId = request.user.sub;
|
||||
data.createdFullName = request.user.name;
|
||||
data.createdAt = new Date();
|
||||
data.lastUpdateUserId = request.user.sub;
|
||||
data.lastUpdateFullName = request.user.name;
|
||||
data.lastUpdatedAt = new Date();
|
||||
await this.child2Repository.save(data);
|
||||
});
|
||||
//clone data
|
||||
const orgChild3 = await this.child3Repository.find({
|
||||
where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
});
|
||||
const _orgChild3 = orgChild3.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child3Repository.save(_orgChild3);
|
||||
delete x.id;
|
||||
const data1 = Object.assign(new OrgChild1(), x);
|
||||
data1.orgRootId = data.id;
|
||||
data1.orgRevisionId = revision.id;
|
||||
data1.createdUserId = request.user.sub;
|
||||
data1.createdFullName = request.user.name;
|
||||
data1.createdAt = new Date();
|
||||
data1.lastUpdateUserId = request.user.sub;
|
||||
data1.lastUpdateFullName = request.user.name;
|
||||
data1.lastUpdatedAt = new Date();
|
||||
await this.child1Repository.save(data1);
|
||||
|
||||
_orgChild3.forEach(async (x: any) => {
|
||||
delete x.id;
|
||||
const data = Object.assign(new OrgChild3(), x);
|
||||
data.orgRevisionId = revision.id;
|
||||
data.createdUserId = request.user.sub;
|
||||
data.createdFullName = request.user.name;
|
||||
data.createdAt = new Date();
|
||||
data.lastUpdateUserId = request.user.sub;
|
||||
data.lastUpdateFullName = request.user.name;
|
||||
data.lastUpdatedAt = new Date();
|
||||
await this.child3Repository.save(data);
|
||||
});
|
||||
//clone data
|
||||
const orgChild4 = await this.child4Repository.find({
|
||||
where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
});
|
||||
const _orgChild4 = orgChild4.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child4Repository.save(_orgChild4);
|
||||
_orgChild2.forEach(async (x: any) => {
|
||||
var data2Id = x.id;
|
||||
//clone data
|
||||
const orgChild3 = await this.child3Repository.find({
|
||||
where: {
|
||||
orgRootId: dataId,
|
||||
orgChild1Id: data1Id,
|
||||
orgChild2Id: data2Id,
|
||||
orgRevisionId: requestBody.orgRevisionId,
|
||||
},
|
||||
});
|
||||
const _orgChild3 = orgChild3.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null ||
|
||||
x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child3Repository.save(_orgChild3);
|
||||
|
||||
_orgChild4.forEach(async (x: any) => {
|
||||
delete x.id;
|
||||
const data = Object.assign(new OrgChild4(), x);
|
||||
data.orgRevisionId = revision.id;
|
||||
data.createdUserId = request.user.sub;
|
||||
data.createdFullName = request.user.name;
|
||||
data.createdAt = new Date();
|
||||
data.lastUpdateUserId = request.user.sub;
|
||||
data.lastUpdateFullName = request.user.name;
|
||||
data.lastUpdatedAt = new Date();
|
||||
await this.child4Repository.save(data);
|
||||
delete x.id;
|
||||
const data2 = Object.assign(new OrgChild2(), x);
|
||||
data2.orgChild1Id = data1.id;
|
||||
data2.orgRootId = data.id;
|
||||
data2.orgRevisionId = revision.id;
|
||||
data2.createdUserId = request.user.sub;
|
||||
data2.createdFullName = request.user.name;
|
||||
data2.createdAt = new Date();
|
||||
data2.lastUpdateUserId = request.user.sub;
|
||||
data2.lastUpdateFullName = request.user.name;
|
||||
data2.lastUpdatedAt = new Date();
|
||||
await this.child2Repository.save(data2);
|
||||
|
||||
_orgChild3.forEach(async (x: any) => {
|
||||
var data3Id = x.id;
|
||||
//clone data
|
||||
const orgChild4 = await this.child4Repository.find({
|
||||
where: {
|
||||
orgRootId: dataId,
|
||||
orgChild1Id: data1Id,
|
||||
orgChild2Id: data2Id,
|
||||
orgChild3Id: data3Id,
|
||||
orgRevisionId: requestBody.orgRevisionId,
|
||||
},
|
||||
});
|
||||
const _orgChild4 = orgChild4.map((x) => ({
|
||||
...x,
|
||||
isAncestorDNA:
|
||||
x.isAncestorDNA == null ||
|
||||
x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
? x.id
|
||||
: x.isAncestorDNA,
|
||||
}));
|
||||
await this.child4Repository.save(_orgChild4);
|
||||
|
||||
delete x.id;
|
||||
const data3 = Object.assign(new OrgChild3(), x);
|
||||
data3.orgChild2Id = data2.id;
|
||||
data3.orgChild1Id = data1.id;
|
||||
data3.orgRootId = data.id;
|
||||
data3.orgRevisionId = revision.id;
|
||||
data3.createdUserId = request.user.sub;
|
||||
data3.createdFullName = request.user.name;
|
||||
data3.createdAt = new Date();
|
||||
data3.lastUpdateUserId = request.user.sub;
|
||||
data3.lastUpdateFullName = request.user.name;
|
||||
data3.lastUpdatedAt = new Date();
|
||||
await this.child3Repository.save(data3);
|
||||
|
||||
_orgChild4.forEach(async (x: any) => {
|
||||
delete x.id;
|
||||
const data4 = Object.assign(new OrgChild4(), x);
|
||||
data4.orgChild3Id = data3.id;
|
||||
data4.orgChild2Id = data2.id;
|
||||
data4.orgChild1Id = data1.id;
|
||||
data4.orgRootId = data.id;
|
||||
data4.orgRevisionId = revision.id;
|
||||
data4.createdUserId = request.user.sub;
|
||||
data4.createdFullName = request.user.name;
|
||||
data4.createdAt = new Date();
|
||||
data4.lastUpdateUserId = request.user.sub;
|
||||
data4.lastUpdateFullName = request.user.name;
|
||||
data4.lastUpdatedAt = new Date();
|
||||
await this.child4Repository.save(data4);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
// //clone data
|
||||
// const orgChild1 = await this.child1Repository.find({
|
||||
// where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
// });
|
||||
// const _orgChild1 = orgChild1.map((x) => ({
|
||||
// ...x,
|
||||
// isAncestorDNA:
|
||||
// x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
// ? x.id
|
||||
// : x.isAncestorDNA,
|
||||
// }));
|
||||
// await this.child1Repository.save(_orgChild1);
|
||||
|
||||
// _orgChild1.forEach(async (x: any) => {
|
||||
// delete x.id;
|
||||
// const data = Object.assign(new OrgChild1(), x);
|
||||
// data.orgRevisionId = revision.id;
|
||||
// data.createdUserId = request.user.sub;
|
||||
// data.createdFullName = request.user.name;
|
||||
// data.createdAt = new Date();
|
||||
// data.lastUpdateUserId = request.user.sub;
|
||||
// data.lastUpdateFullName = request.user.name;
|
||||
// data.lastUpdatedAt = new Date();
|
||||
// await this.child1Repository.save(data);
|
||||
// });
|
||||
// //clone data
|
||||
// const orgChild2 = await this.child2Repository.find({
|
||||
// where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
// });
|
||||
// const _orgChild2 = orgChild2.map((x) => ({
|
||||
// ...x,
|
||||
// isAncestorDNA:
|
||||
// x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
// ? x.id
|
||||
// : x.isAncestorDNA,
|
||||
// }));
|
||||
// await this.child2Repository.save(_orgChild2);
|
||||
|
||||
// _orgChild2.forEach(async (x: any) => {
|
||||
// delete x.id;
|
||||
// const data = Object.assign(new OrgChild2(), x);
|
||||
// data.orgRevisionId = revision.id;
|
||||
// data.createdUserId = request.user.sub;
|
||||
// data.createdFullName = request.user.name;
|
||||
// data.createdAt = new Date();
|
||||
// data.lastUpdateUserId = request.user.sub;
|
||||
// data.lastUpdateFullName = request.user.name;
|
||||
// data.lastUpdatedAt = new Date();
|
||||
// await this.child2Repository.save(data);
|
||||
// });
|
||||
// //clone data
|
||||
// const orgChild3 = await this.child3Repository.find({
|
||||
// where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
// });
|
||||
// const _orgChild3 = orgChild3.map((x) => ({
|
||||
// ...x,
|
||||
// isAncestorDNA:
|
||||
// x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
// ? x.id
|
||||
// : x.isAncestorDNA,
|
||||
// }));
|
||||
// await this.child3Repository.save(_orgChild3);
|
||||
|
||||
// _orgChild3.forEach(async (x: any) => {
|
||||
// delete x.id;
|
||||
// const data = Object.assign(new OrgChild3(), x);
|
||||
// data.orgRevisionId = revision.id;
|
||||
// data.createdUserId = request.user.sub;
|
||||
// data.createdFullName = request.user.name;
|
||||
// data.createdAt = new Date();
|
||||
// data.lastUpdateUserId = request.user.sub;
|
||||
// data.lastUpdateFullName = request.user.name;
|
||||
// data.lastUpdatedAt = new Date();
|
||||
// await this.child3Repository.save(data);
|
||||
// // });
|
||||
// //clone data
|
||||
// const orgChild4 = await this.child4Repository.find({
|
||||
// where: { orgRevisionId: requestBody.orgRevisionId },
|
||||
// });
|
||||
// const _orgChild4 = orgChild4.map((x) => ({
|
||||
// ...x,
|
||||
// isAncestorDNA:
|
||||
// x.isAncestorDNA == null || x.isAncestorDNA == "00000000-0000-0000-0000-000000000000"
|
||||
// ? x.id
|
||||
// : x.isAncestorDNA,
|
||||
// }));
|
||||
// await this.child4Repository.save(_orgChild4);
|
||||
|
||||
// _orgChild4.forEach(async (x: any) => {
|
||||
// delete x.id;
|
||||
// const data = Object.assign(new OrgChild4(), x);
|
||||
// data.orgRevisionId = revision.id;
|
||||
// data.createdUserId = request.user.sub;
|
||||
// data.createdFullName = request.user.name;
|
||||
// data.createdAt = new Date();
|
||||
// data.lastUpdateUserId = request.user.sub;
|
||||
// data.lastUpdateFullName = request.user.name;
|
||||
// data.lastUpdatedAt = new Date();
|
||||
// await this.child4Repository.save(data);
|
||||
// });
|
||||
} else if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION") {
|
||||
} else if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON") {
|
||||
}
|
||||
|
|
@ -309,7 +444,7 @@ export class OrganizationController extends Controller {
|
|||
"orgRoot.orgRevisionId",
|
||||
"orgRoot.orgRootRank",
|
||||
])
|
||||
.orderBy("orgRoot.createdAt","ASC")
|
||||
.orderBy("orgRoot.createdAt", "ASC")
|
||||
.getMany();
|
||||
|
||||
const orgRootIds = orgRootData.map((orgRoot) => orgRoot.id) || null;
|
||||
|
|
@ -330,7 +465,7 @@ export class OrganizationController extends Controller {
|
|||
"orgChild1.orgRootId",
|
||||
"orgChild1.orgChild1Rank",
|
||||
])
|
||||
.orderBy("orgChild1.createdAt","ASC")
|
||||
.orderBy("orgChild1.createdAt", "ASC")
|
||||
.getMany()
|
||||
: [];
|
||||
|
||||
|
|
@ -354,7 +489,7 @@ export class OrganizationController extends Controller {
|
|||
|
||||
"orgChild2.orgChild1Id",
|
||||
])
|
||||
.orderBy("orgChild2.createdAt","ASC")
|
||||
.orderBy("orgChild2.createdAt", "ASC")
|
||||
.getMany()
|
||||
: [];
|
||||
|
||||
|
|
@ -378,7 +513,7 @@ export class OrganizationController extends Controller {
|
|||
|
||||
"orgChild3.orgChild2Id",
|
||||
])
|
||||
.orderBy("orgChild3.createdAt","ASC")
|
||||
.orderBy("orgChild3.createdAt", "ASC")
|
||||
.getMany()
|
||||
: [];
|
||||
|
||||
|
|
@ -402,7 +537,7 @@ export class OrganizationController extends Controller {
|
|||
|
||||
"orgChild4.orgChild3Id",
|
||||
])
|
||||
.orderBy("orgChild4.createdAt","ASC")
|
||||
.orderBy("orgChild4.createdAt", "ASC")
|
||||
.getMany()
|
||||
: [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue