fix ประวัติการศึกษา

This commit is contained in:
Bright 2024-11-11 14:42:31 +07:00
parent 6055802f10
commit 96957663e5
3 changed files with 48 additions and 21 deletions

View file

@ -231,14 +231,20 @@ export class ProfileEmployeeController extends Controller {
where: { profileEmployeeId: id },
order: { lastUpdatedAt: "DESC" },
});
const Education = educations.map((item) => ({
Institute: item.institute ? item.institute : "-",
Date:
item.startDate && item.endDate
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
: "-",
Degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
}));
const Education = educations && educations.length > 0
? educations.map((item) => ({
institute: item.institute ? item.institute : "-",
date:
item.startDate && item.endDate
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
: "-",
degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
}))
: [{
institute: "-",
date: "-",
degree: "-",
}]
const mapData = {
// Id: profile.id,