diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index c5010d98..4aac4fbf 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -301,7 +301,7 @@ export class ProfileController extends Controller { const _child3 = child3 ? `${child3.orgChild3Name}/` : ""; const _child4 = child4 ? `${child4.orgChild4Name}/` : ""; - const profile = { + const Profile = { CitizenId: profiles?.citizenId ?? null, Prefix: profiles?.prefix != null ? profiles.prefix : "", FirstName: profiles?.firstName != null ? profiles.firstName : "", @@ -362,7 +362,7 @@ export class ProfileController extends Controller { where: { profileId: id }, select: ["certificateType", "issuer", "certificateNo", "issueDate"], }); - const cert = certs.map((item) => ({ + const Cert = certs.map((item) => ({ CertificateType: item.certificateType ?? null, Issuer: item.issuer ?? null, CertificateNo: item.certificateNo ?? null, @@ -372,7 +372,7 @@ export class ProfileController extends Controller { select: ["startDate", "endDate", "place", "department"], where: { profileId: id }, }); - const training = trainings.map((item) => ({ + const Training = trainings.map((item) => ({ institute: item.department ?? null, start: Extension.ToThaiShortDate(item.startDate) ?? null, end: Extension.ToThaiShortDate(item.endDate) ?? null, @@ -385,7 +385,7 @@ export class ProfileController extends Controller { select: ["refCommandDate", "refCommandNo", "detail"], where: { profileId: id }, }); - const discipline = disciplines.map((item) => ({ + const Discipline = disciplines.map((item) => ({ DisciplineYear: new Date(item.refCommandDate).getFullYear() ?? null, DisciplineDetail: item.detail ?? null, RefNo: item.refCommandNo ?? null, @@ -395,7 +395,7 @@ export class ProfileController extends Controller { select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"], where: { profileId: id }, }); - const education = educations.map((item) => ({ + const Education = educations.map((item) => ({ Institute: item.institute ?? null, Start: new Date(item.startDate).getFullYear() ?? null, End: new Date(item.endDate).getFullYear() ?? null, @@ -416,7 +416,7 @@ export class ProfileController extends Controller { where: { profileId: id }, }); - const salary = salarys.map((item) => ({ + const Salary = salarys.map((item) => ({ SalaryDate: Extension.ToThaiShortDate(item.date) ?? null, Position: item.position ?? null, PosNo: item.posNo ?? null, @@ -429,12 +429,12 @@ export class ProfileController extends Controller { OcFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`, })); return new HttpSuccess({ - profile, - cert, - training, - discipline, - education, - salary, + Profile, + Cert, + Training, + Discipline, + Education, + Salary, }); } /** diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 1918c3d7..d615bbf5 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -314,7 +314,7 @@ export class ProfileEmployeeController extends Controller { const _child3 = child3 ? `${child3.orgChild3Name}/` : ""; const _child4 = child4 ? `${child4.orgChild4Name}/` : ""; - const profile = { + const Profile = { CitizenId: profiles?.citizenId ?? null, Prefix: profiles?.prefix != null ? profiles.prefix : "", FirstName: profiles?.firstName != null ? profiles.firstName : "", @@ -375,7 +375,7 @@ export class ProfileEmployeeController extends Controller { where: { profileEmployeeId: id }, select: ["certificateType", "issuer", "certificateNo", "issueDate"], }); - const cert = certs.map((item) => ({ + const Cert = certs.map((item) => ({ CertificateType: item.certificateType ?? null, Issuer: item.issuer ?? null, CertificateNo: item.certificateNo ?? null, @@ -385,7 +385,7 @@ export class ProfileEmployeeController extends Controller { select: ["startDate", "endDate", "place", "department"], where: { profileEmployeeId: id }, }); - const training = trainings.map((item) => ({ + const Training = trainings.map((item) => ({ institute: item.department ?? null, start: Extension.ToThaiShortDate(item.startDate) ?? null, end: Extension.ToThaiShortDate(item.endDate) ?? null, @@ -398,7 +398,7 @@ export class ProfileEmployeeController extends Controller { select: ["refCommandDate", "refCommandNo", "detail"], where: { profileEmployeeId: id }, }); - const discipline = disciplines.map((item) => ({ + const Discipline = disciplines.map((item) => ({ DisciplineYear: new Date(item.refCommandDate).getFullYear() ?? null, DisciplineDetail: item.detail ?? null, RefNo: item.refCommandNo ?? null, @@ -408,7 +408,7 @@ export class ProfileEmployeeController extends Controller { select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"], where: { profileEmployeeId: id }, }); - const education = educations.map((item) => ({ + const Education = educations.map((item) => ({ Institute: item.institute ?? null, Start: new Date(item.startDate).getFullYear() ?? null, End: new Date(item.endDate).getFullYear() ?? null, @@ -429,7 +429,7 @@ export class ProfileEmployeeController extends Controller { where: { profileEmployeeId: id }, }); - const salary = salarys.map((item) => ({ + const Salary = salarys.map((item) => ({ SalaryDate: Extension.ToThaiShortDate(item.date) ?? null, Position: item.position ?? null, PosNo: item.posNo ?? null, @@ -441,7 +441,7 @@ export class ProfileEmployeeController extends Controller { FullName: `${profiles?.prefix} ${profiles?.firstName} ${profiles?.lastName}`, OcFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`, })); - return new HttpSuccess({ profile, cert, training, discipline, education, salary }); + return new HttpSuccess({ Profile, Cert, Training, Discipline, Education, Salary }); } /**