sort data

This commit is contained in:
AdisakKanthawilang 2024-06-06 19:17:51 +07:00
parent 823fcb8ea8
commit 40082d9ffc

View file

@ -249,16 +249,19 @@ export class ProfileController extends Controller {
const profileFamilyCouple = await this.profileFamilyCoupleRepository.findOne({
where: { profileId: id },
select: ["couplePrefix", "coupleFirstName", "coupleLastNameOld"],
order: {lastUpdatedAt: "DESC"}
});
const profileFamilyMother = await this.profileFamilyMotherRepository.findOne({
where: { profileId: id },
select: ["motherPrefix", "motherFirstName", "motherLastName"],
order: { lastUpdatedAt: "DESC" },
});
const profileFamilyFather = await this.profileFamilyFatherRepository.findOne({
where: { profileId: id },
select: ["fatherPrefix", "fatherFirstName", "fatherLastName"],
order: { lastUpdatedAt: "DESC" },
});
const root =
@ -420,6 +423,7 @@ export class ProfileController extends Controller {
const educations = await this.educationRepository.find({
select: ["startDate", "endDate", "educationLevel", "degree", "field", "institute"],
where: { profileId: id },
order: {lastUpdatedAt:"DESC"},
});
const Education = educations.map((item) => ({
Institute: item.institute,