diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index ca04f84a..3bff75c8 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -378,7 +378,7 @@ export class ProfileController extends Controller { IssueDate: Extension.ToThaiNumber(Extension.ToThaiShortDate(item.issueDate)) ?? null, })); const trainings = await this.trainingRepository.find({ - select: ["startDate", "endDate", "place", "department"], + select: ["startDate", "endDate", "place", "department", "name"], where: { profileId: id }, }); const Training = trainings.map((item) => ({ @@ -386,14 +386,18 @@ export class ProfileController extends Controller { Start: item.startDate == null ? "" - : Extension.ToThaiNumber(Extension.ToThaiShortDate(item.startDate).toString()), + : Extension.ToThaiNumber(new Date(item.startDate).getFullYear().toString()), End: item.endDate == null ? "" - : Extension.ToThaiNumber(Extension.ToThaiShortDate(item.endDate).toString()), + : Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString()), + Date: + item.startDate && item.endDate + ? `${Extension.ToThaiNumber(new Date(item.startDate).getFullYear().toString())} - ${Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString())}` + : "", Level: "", - Degree: "", - Field: item.place ?? "", + Degree: item.name, + Field: "", })); const disciplines = await this.disciplineRepository.find({ @@ -421,8 +425,12 @@ export class ProfileController extends Controller { item.endDate == null ? "" : Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString()), + Date: + item.startDate && item.endDate + ? `${Extension.ToThaiNumber(new Date(item.startDate).getFullYear().toString())} - ${Extension.ToThaiNumber(new Date(item.endDate).getFullYear().toString())}` + : "", Level: item.educationLevel ?? "", - Degree: item.degree, + Degree: item.degree && item.field ? `${item.degree} ${item.field}` : "", Field: item.field ?? "-", })); const salarys = await this.salaryRepository.find({