diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index d1547ccf..5d610eaa 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -244,12 +244,22 @@ export class ProfileController extends Controller { date: item.date ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) : null, positionLine: item.positionLine != null ? item.positionLine : "-", posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null, + orgRoot: item.orgRoot, + orgChild1: item.orgChild1, + orgChild2: item.orgChild2, + orgChild3: item.orgChild3, + orgChild4: item.orgChild4, })) : [ { date: "-", positionLine: "-", posNo: "-", + orgRoot: null, + orgChild1: null, + orgChild2: null, + orgChild3: null, + orgChild4: null, }, ]; @@ -309,13 +319,39 @@ export class ProfileController extends Controller { salary_raw.length > 0 && salary_raw[0].posNo != null ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].posNo)) : "-", - positionLine: - salary_raw.length > 0 && salary_raw[0].positionLine != null - ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionLine)) + position: + salary_raw.length > 0 && salary_raw[0].position != null + ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].position)) : "-", + org: `${ + salary_raw.length > 0 && salary_raw[0].orgChild4 != null + ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild4)) + " " + : "" + }${ + salary_raw.length > 0 && salary_raw[0].orgChild3 != null + ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild3)) + " " + : "" + }${ + salary_raw.length > 0 && salary_raw[0].orgChild2 != null + ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild2)) + " " + : "" + }${ + salary_raw.length > 0 && salary_raw[0].orgChild1 != null + ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgChild1)) + " " + : "" + }${ + salary_raw.length > 0 && salary_raw[0].orgRoot != null + ? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].orgRoot)) + : "" + }`, ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`, educations: Education, - salarys: salarys, + salarys: salarys.map((item) => { + return { + ...item, + org: `${item.orgChild4 != null ? item.orgChild4 + " " : ""}${item.orgChild3 != null ? item.orgChild3 + " " : ""}${item.orgChild2 != null ? item.orgChild2 + " " : ""}${item.orgChild1 != null ? item.orgChild1 + " " : ""}${item.orgRoot != null ? item.orgRoot + " " : ""}`, + }; + }), url: ImgUrl ? ImgUrl : `${process.env.VITE_URL_MGT}`, };