fix feild name orgRootId

This commit is contained in:
AdisakKanthawilang 2024-01-30 13:22:19 +07:00
parent 2d422de102
commit 3db66d0df2
2 changed files with 5 additions and 5 deletions

View file

@ -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 } });

View file

@ -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,