From 06c7c68cf156869c56b5fbdf698427236fd8dce1 Mon Sep 17 00:00:00 2001 From: Stefanos Hadjipetrou Date: Tue, 11 Jul 2023 14:29:21 +0300 Subject: [PATCH] feat: add default order by to goals n objectives --- src/config/mapping/grants/grantDetail.utils.json | 1 + src/controllers/grants.controller.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/mapping/grants/grantDetail.utils.json b/src/config/mapping/grants/grantDetail.utils.json index 66ae7ae..14c26a5 100644 --- a/src/config/mapping/grants/grantDetail.utils.json +++ b/src/config/mapping/grants/grantDetail.utils.json @@ -12,5 +12,6 @@ "periodInfoRatingGrantNumber": "grantAgreementImplementationPeriod/grantAgreement/grantAgreementNumber", "periodInfoRatingPeriodNumber": "grantAgreementImplementationPeriod/implementationPeriodNumber", "periodInfoRatingExtraFilter": " and performanceRating ne null", + "goalsObjectivesSort": "$orderby=goalObjectiveIndex asc,goalObjectiveName asc&", "grantNumber": "grantAgreementNumber" } diff --git a/src/controllers/grants.controller.ts b/src/controllers/grants.controller.ts index 49d7a2d..b025ed2 100644 --- a/src/controllers/grants.controller.ts +++ b/src/controllers/grants.controller.ts @@ -343,7 +343,7 @@ export class GrantsController { }; } const mapper = mapTransform(grantPeriodGoalsObjectivesMap); - const url = `${urls.grantIPGoalsObjectives}/?$filter=${grantDetailUtils.periodInfoRatingGrantNumber} eq '${grantNumber}' AND ${grantDetailUtils.periodInfoRatingPeriodNumber} eq ${IPnumber}`; + const url = `${urls.grantIPGoalsObjectives}/?$filter=${grantDetailUtils.periodInfoRatingGrantNumber} eq '${grantNumber}' AND ${grantDetailUtils.periodInfoRatingPeriodNumber} eq ${IPnumber}&${grantDetailUtils.goalsObjectivesSort}`; return axios .get(url)