diff --git a/src/controllers/OrgRootController.ts b/src/controllers/OrgRootController.ts index 7af651de..63263736 100644 --- a/src/controllers/OrgRootController.ts +++ b/src/controllers/OrgRootController.ts @@ -184,7 +184,7 @@ export class OrgRootController extends Controller { const orgRoot = await this.orgRootRepository.findOne({ where: { id } }); if (!orgRoot) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล"); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงสร้างระดับ Root ตามไอดีนี้ :" + id); } try { orgRoot.lastUpdateUserId = request.user.sub; @@ -210,7 +210,7 @@ export class OrgRootController extends Controller { async delete(@Path() id: string) { const orgRoot = await this.orgRootRepository.findOne({ where: { id } }); if (!orgRoot) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล"); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงสร้างระดับ Root ตามไอดีนี้ :" + id); } const orgChild1 = await this.orgChild1Repository.findOne({ where: { orgRootId: id } }); diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 43b0c9d8..32f05946 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -436,7 +436,7 @@ export class OrganizationController extends Controller { .filter((orgChild2) => orgChild2.orgChild1Id === orgChild1.id) .map((orgChild2) => ({ orgTreeId: orgChild2.id, - orgChild1Id: orgChild1.id, + orgRootId: orgChild1.id, orgLevel: 2, orgTreeName: orgChild2.orgChild2Name, orgTreeShortName: orgChild2.orgChild2ShortName, @@ -453,7 +453,7 @@ export class OrganizationController extends Controller { .filter((orgChild3) => orgChild3.orgChild2Id === orgChild2.id) .map((orgChild3) => ({ orgTreeId: orgChild3.id, - orgChild2Id: orgChild2.id, + orgRootId: orgChild2.id, orgLevel: 3, orgTreeName: orgChild3.orgChild3Name, orgTreeShortName: orgChild3.orgChild3ShortName, @@ -470,7 +470,7 @@ export class OrganizationController extends Controller { .filter((orgChild4) => orgChild4.orgChild3Id === orgChild3.id) .map((orgChild4) => ({ orgTreeId: orgChild4.id, - orgChild3Id: orgChild3.id, + orgRootId: orgChild3.id, orgLevel: 4, orgTreeName: orgChild4.orgChild4Name, orgTreeShortName: orgChild4.orgChild4ShortName,