From 40082d9ffc9669fe5c0fd1ce996180312bcf2d06 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 6 Jun 2024 19:17:51 +0700 Subject: [PATCH] sort data --- src/controllers/ProfileController.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 29e9e60a..8ad9018c 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -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,