From 6b82039a361db5ed00839327da3e6d624886b672 Mon Sep 17 00:00:00 2001 From: xKeCo Date: Tue, 3 Dec 2024 11:33:38 -0500 Subject: [PATCH 1/7] :recycle: refactor(outcome indicators) P2-903: update UI narratives and data models for enhanced indicator details --- .../pages/eioi-home/eoio-home.component.html | 4 ++-- .../indicator-details.component.html | 12 ++++++++++++ .../indicator-details/indicator-details.component.ts | 3 +-- .../indicator-details/models/indicator-data.model.ts | 1 + .../pages/wp-home/wp-home.component.html | 6 ++++-- .../contribution-to-indicator-result.repository.ts | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.html b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.html index cf8532013..348f005a3 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.html +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.html @@ -2,7 +2,7 @@
arrow_back
-

Indicator list

+

End of Initiative Outcome Indicators List

@@ -27,7 +27,7 @@

Indicator list

[tableStyle]="{ 'min-width': '80rem' }"> - Outcome + EOI Outcome Indicator Indicator Type Expected Target diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.html b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.html index 0ecec43eb..283e5adfe 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.html +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.html @@ -13,6 +13,18 @@

+
+
+ + +

Work Package

+
+ +

+ {{ this.indicatorData?.workpackage_short_name ? this.indicatorData.workpackage_short_name + ': ' : '' }} + {{ this.indicatorData?.workpackage_name ?? 'Not specified' }} +

+
@for (item of indicatorInfoItems; track $index) {
diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts index 7fbf46c34..5d2c78381 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts @@ -28,8 +28,7 @@ export class IndicatorDetailsComponent implements OnInit { loading = true; indicatorInfoItems = [ - { icon: '', label: 'Work Package', value: 'workpackage_name', iconClass: 'pi pi-box' }, - { icon: 'login', label: 'Outcome', value: 'outcome_description', iconClass: 'material-icons-round' }, + { icon: 'login', label: 'Outcome', value: 'outcome_name', iconClass: 'material-icons-round' }, { icon: 'show_chart', label: 'Unit of measurement', value: 'unit_measurement', iconClass: 'material-icons-round' }, { icon: '', label: 'Baseline', value: 'indicator_baseline', iconClass: 'pi pi-chart-bar' }, { icon: '', label: 'Target', value: 'indicator_target', iconClass: 'pi pi-bullseye' } diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts index 25e77c7d2..262a001a4 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts @@ -10,6 +10,7 @@ export class IndicatorData { outcome_name: string; outcome_description: string; workpackage_name: string; + workpackage_short_name: string; submission_status: string; contributing_results: ContributingResult[]; } diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/wp-home/wp-home.component.html b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/wp-home/wp-home.component.html index fdb8c3294..f2c63f680 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/wp-home/wp-home.component.html +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/wp-home/wp-home.component.html @@ -2,7 +2,7 @@
arrow_back
-

Indicator list

+

Work Package Outcome Indicators List

@@ -35,7 +35,9 @@

Indicator list

[expandedRowKeys]="this.outcomeIService.expandedRows"> - Outcome + + Work Package Outcome + Indicator Indicator Type Expected Target diff --git a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts index 10b0526b7..f0284a463 100644 --- a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts +++ b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts @@ -28,7 +28,7 @@ export class ContributionToIndicatorResultsRepository extends Repository', ci.short_name, ' - ', ci.name) as indicator_initiative, + wp.acronym as workpackage_short_name, concat(ci.official_code, ' - ', ci.short_name, ' - ', ci.name) as indicator_initiative, ( CASE when indicator_s.result_status_id = 1 then 0 From f170721e94110f9a303d62280faeed2250996269 Mon Sep 17 00:00:00 2001 From: xKeCo Date: Tue, 3 Dec 2024 12:19:52 -0500 Subject: [PATCH 2/7] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(indicator=20d?= =?UTF-8?q?etails)=20P2-903:=20enhance=20updateIndicatorData=20logic=20and?= =?UTF-8?q?=20add=20initiative=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/eioi-home/eoio-home.component.ts | 2 +- .../indicator-details.component.spec.ts | 32 ++++++++++++++++++- .../indicator-details.component.ts | 7 ++++ .../models/indicator-data.model.ts | 2 ++ ...ribution-to-indicator-result.repository.ts | 2 +- 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.ts b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.ts index e5ab8efdf..e90bf9956 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.ts +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/eioi-home/eoio-home.component.ts @@ -1,5 +1,5 @@ import { CommonModule } from '@angular/common'; -import { ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit, signal } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, OnDestroy } from '@angular/core'; import { TableModule } from 'primeng/table'; import { ApiService } from '../../../../shared/services/api/api.service'; import { ButtonModule } from 'primeng/button'; diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.spec.ts b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.spec.ts index fd3952da0..62b4a06c4 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.spec.ts +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.spec.ts @@ -20,7 +20,9 @@ describe('IndicatorDetailsComponent', () => { GET_contributionsToIndicators_indicator: jest.fn().mockReturnValue(of({})), POST_contributionsToIndicators: jest.fn().mockReturnValue(of({})), PATCH_contributionsToIndicators: jest.fn().mockReturnValue(of({})), - POST_contributionsToIndicatorsSubmit: jest.fn().mockReturnValue(of({})) + POST_contributionsToIndicatorsSubmit: jest.fn().mockReturnValue(of({})), + GET_contributionsToIndicatorsWPS: jest.fn().mockReturnValue(of({})), + GET_contributionsToIndicatorsEOIS: jest.fn().mockReturnValue(of({})) }, alertsFe: { show: jest.fn().mockImplementationOnce((config, callback) => { @@ -98,6 +100,34 @@ describe('IndicatorDetailsComponent', () => { expect(component.updateIndicatorData).toHaveBeenCalledWith(response); }); + it('should update indicator data and set loading to false in updateIndicatorData', () => { + const response = { contributionToIndicator: { someData: 'data', initiative_official_code: '123' } }; + component.updateIndicatorData(response); + expect(component.indicatorData).toEqual(response.contributionToIndicator); + expect(component.loading).toBe(false); + }); + + it('should call getWorkPackagesData and getEOIsData if initiativeIdFilter is different', () => { + const response = { contributionToIndicator: { someData: 'data', initiative_official_code: '123' } }; + component.outcomeIService.initiativeIdFilter = '456'; + jest.spyOn(component.outcomeIService, 'getWorkPackagesData'); + jest.spyOn(component.outcomeIService, 'getEOIsData'); + component.updateIndicatorData(response); + expect(component.outcomeIService.initiativeIdFilter).toBe('123'); + expect(component.outcomeIService.getWorkPackagesData).toHaveBeenCalled(); + expect(component.outcomeIService.getEOIsData).toHaveBeenCalled(); + }); + + it('should not call getWorkPackagesData and getEOIsData if initiativeIdFilter is the same', () => { + const response = { contributionToIndicator: { someData: 'data', initiative_official_code: '123' } }; + component.outcomeIService.initiativeIdFilter = '123'; + jest.spyOn(component.outcomeIService, 'getWorkPackagesData'); + jest.spyOn(component.outcomeIService, 'getEOIsData'); + component.updateIndicatorData(response); + expect(component.outcomeIService.getWorkPackagesData).not.toHaveBeenCalled(); + expect(component.outcomeIService.getEOIsData).not.toHaveBeenCalled(); + }); + it('should handle 404 response in handleGetIndicatorResponse', () => { component.indicatorId = '123'; const response = { status: 404 }; diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts index 5d2c78381..20a59d1e9 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/indicator-details.component.ts @@ -88,6 +88,13 @@ export class IndicatorDetailsComponent implements OnInit { updateIndicatorData(response: any) { this.indicatorData = response?.contributionToIndicator; + + if (this.outcomeIService.initiativeIdFilter !== this.indicatorData.initiative_official_code) { + this.outcomeIService.initiativeIdFilter = this.indicatorData.initiative_official_code; + this.outcomeIService.getWorkPackagesData(); + this.outcomeIService.getEOIsData(); + } + this.loading = false; } diff --git a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts index 262a001a4..c11d35bd5 100644 --- a/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts +++ b/onecgiar-pr-client/src/app/pages/outcome-indicator/pages/indicator-details/models/indicator-data.model.ts @@ -12,6 +12,8 @@ export class IndicatorData { workpackage_name: string; workpackage_short_name: string; submission_status: string; + initiative_official_code: string; + indicator_initiative: string; contributing_results: ContributingResult[]; } diff --git a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts index f0284a463..29b263d20 100644 --- a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts +++ b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts @@ -28,7 +28,7 @@ export class ContributionToIndicatorResultsRepository extends Repository', ci.short_name, ' - ', ci.name) as indicator_initiative, + wp.acronym as workpackage_short_name, concat(ci.official_code, ' - ', ci.short_name, ' - ', ci.name) as indicator_initiative, ci.official_code as initiative_official_code, ( CASE when indicator_s.result_status_id = 1 then 0 From ea5163d794ceaccfd80afcca49c762cd6c82f8b3 Mon Sep 17 00:00:00 2001 From: German Martinez Date: Tue, 10 Dec 2024 14:38:08 -0500 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=90=9Bfix(CoI):=20adding=20missing=20?= =?UTF-8?q?join=20to=20recover=20missing=20results=20from=20previous=20pha?= =?UTF-8?q?ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contribution-to-indicator-result.repository.ts | 7 ++++--- .../repositories/contribution-to-indicators.repository.ts | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts index 10b0526b7..1d8df4faa 100644 --- a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts +++ b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts @@ -99,11 +99,12 @@ export class ContributionToIndicatorResultsRepository extends Repository Date: Wed, 11 Dec 2024 11:10:58 -0500 Subject: [PATCH 4/7] =?UTF-8?q?=E2=99=BB=EF=B8=8Frefactor(CoI):=20adding?= =?UTF-8?q?=20initiative=20parameter=20to=20all=20results=20endpoint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/results/result.repository.ts | 14 +++++++++++--- .../src/api/results/results.controller.ts | 7 +++++-- .../src/api/results/results.service.ts | 8 ++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/onecgiar-pr-server/src/api/results/result.repository.ts b/onecgiar-pr-server/src/api/results/result.repository.ts index 704567a88..73f1e202c 100644 --- a/onecgiar-pr-server/src/api/results/result.repository.ts +++ b/onecgiar-pr-server/src/api/results/result.repository.ts @@ -484,7 +484,11 @@ WHERE } }*/ - async AllResultsByRoleUsers(userid: number, excludeType = [10, 11]) { + async AllResultsByRoleUserAndInitiative( + userid: number, + excludeType = [10, 11], + initiativeCode?: string, + ) { const queryData = ` SELECT r.id, @@ -533,11 +537,15 @@ WHERE AND rbi.is_active > 0 AND rbi.initiative_role_id = 1 AND ci.active > 0 - AND rt.id not in (${excludeType.toString()}); + AND rt.id not in (${excludeType.toString()}) + ${initiativeCode ? 'AND ci.official_code = ?' : ''}; `; try { - const results = await this.query(queryData, [userid]); + const results = await this.query( + queryData, + ([userid] as any[]).concat(initiativeCode ? [initiativeCode] : []), + ); return results; } catch (error) { throw { diff --git a/onecgiar-pr-server/src/api/results/results.controller.ts b/onecgiar-pr-server/src/api/results/results.controller.ts index cdd0418ee..a96bbab2a 100644 --- a/onecgiar-pr-server/src/api/results/results.controller.ts +++ b/onecgiar-pr-server/src/api/results/results.controller.ts @@ -63,8 +63,11 @@ export class ResultsController { } @Get('get/all/roles/:userId') - findAllResultRoles(@Param('userId') userId: number) { - return this.resultsService.findAllByRole(userId); + findAllResultRoles( + @Param('userId') userId: number, + @Query('initiative') init?: string, + ) { + return this.resultsService.findAllByRole(userId, init); } @Get('get/depth-search/:title') diff --git a/onecgiar-pr-server/src/api/results/results.service.ts b/onecgiar-pr-server/src/api/results/results.service.ts index f7b75afcd..6c36b6a42 100644 --- a/onecgiar-pr-server/src/api/results/results.service.ts +++ b/onecgiar-pr-server/src/api/results/results.service.ts @@ -885,10 +885,14 @@ export class ResultsService { } } - async findAllByRole(userId: number) { + async findAllByRole(userId: number, initiativeCode?: string) { try { const result: any[] = - await this._customResultRepository.AllResultsByRoleUsers(userId); + await this._customResultRepository.AllResultsByRoleUserAndInitiative( + userId, + undefined, + initiativeCode, + ); if (!result.length) { throw { From f80012bfbbe4f724d3e6db831dd5ebc3a507cfbd Mon Sep 17 00:00:00 2001 From: Kevin Collazos Date: Thu, 12 Dec 2024 11:48:40 -0500 Subject: [PATCH 5/7] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(result.spec.t?= =?UTF-8?q?s)=20P2-903:=20refactor=20unit=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- onecgiar-pr-server/src/api/results/result.spec.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/onecgiar-pr-server/src/api/results/result.spec.ts b/onecgiar-pr-server/src/api/results/result.spec.ts index f6a4747cf..38fe1991d 100644 --- a/onecgiar-pr-server/src/api/results/result.spec.ts +++ b/onecgiar-pr-server/src/api/results/result.spec.ts @@ -271,15 +271,6 @@ describe('Result service unit test', () => { expect(results.response[0].id).toBeDefined(); }); - it('should error when not found result', async () => { - jest - .spyOn(resultService['_customResultRepository'], 'AllResultsByRoleUsers') - .mockResolvedValue(() => Promise.resolve([])); - const results = resultService.findAllByRole(-1); - expect((await results).message).toBe('Results Not Found'); - expect((await results).status).toBe(HttpStatus.NOT_FOUND); - }); - it('should return all results legacy new', async () => { const title = 'Assessment of the pote'; const results = await resultService.findAllResultsLegacyNew(title); From 4fdd0406902af109aad6b482f058c60dc61dde4a Mon Sep 17 00:00:00 2001 From: German Martinez Date: Fri, 13 Dec 2024 08:55:39 -0500 Subject: [PATCH 6/7] =?UTF-8?q?=E2=99=BB=EF=B8=8Frefactor(CoI):=20removing?= =?UTF-8?q?=20linked=20results;=20changing=20property=20names=20for=20resu?= =?UTF-8?q?lts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ribution-to-indicator-result.repository.ts | 32 ++------------- .../contribution-to-indicators.repository.ts | 40 +++---------------- 2 files changed, 8 insertions(+), 64 deletions(-) diff --git a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts index 5a87385e4..373181c94 100644 --- a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts +++ b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicator-result.repository.ts @@ -73,35 +73,9 @@ export class ContributionToIndicatorResultsRepository extends Repository { const dataQuery = ` - select main_ctir.id as contribution_id, main_ctir.is_active, main_r.id as result_id, main_r.result_code, main_r.title as result_title, - main_v.phase_name, main_v.id as phase_id, main_rt.name as result_type, main_ci.official_code as result_submitter, - main_rs.status_name as result_status, date_format(main_r.created_date, '%Y-%m-%d') as result_creation_date, - ( - select json_arrayagg(json_object( - "contribution_id", linked_ctir.id, - "is_active", linked_ctir.is_active, - "result_id", linked_r.id, - "result_code", linked_r.result_code, - "result_title", linked_r.title, - "phase_name", linked_v.phase_name, - "phase_id", linked_v.id, - "result_type", linked_rt.name, - "result_submitter", linked_ci.official_code, - "result_status", linked_rs.status_name, - "result_creation_date", date_format(linked_r.created_date, '%Y-%m-%d') - )) - from ${env.DB_NAME}.linked_result lr - left join ${env.DB_NAME}.result linked_r on linked_r.id = lr.linked_results_id and linked_r.is_active - left join ${env.DB_NAME}.contribution_to_indicator_results linked_ctir on linked_ctir.result_id = linked_r.id - and linked_ctir.contribution_to_indicator_id = cti.id - left join ${env.DB_NAME}.\`version\` linked_v on linked_r.version_id = linked_v.id - left join ${env.DB_NAME}.result_type linked_rt on linked_r.result_type_id = linked_rt.id - left join ${env.DB_NAME}.results_by_inititiative linked_rbi on linked_rbi.result_id = linked_r.id and linked_rbi.initiative_role_id = 1 - left join ${env.DB_NAME}.clarisa_initiatives linked_ci on linked_ci.id = linked_rbi.inititiative_id - left join ${env.DB_NAME}.result_status linked_rs on linked_rs.result_status_id = linked_r.status_id - where lr.origin_result_id = main_r.id and lr.is_active and linked_r.id is not null - group by main_r.id - ) as linked_results + select main_ctir.id as contribution_id, main_ctir.is_active, main_r.id as result_id, main_r.result_code, main_r.title, + main_v.phase_name, main_v.id as version_id, main_rt.name as result_type, main_ci.official_code as result_submitter, + main_rs.status_name, date_format(main_r.created_date, '%Y-%m-%d') as created_date from ${env.DB_TOC}.toc_results_indicators tri right join ${env.DB_TOC}.toc_results indicator_outcome on tri.toc_results_id = indicator_outcome.id right join ${env.DB_TOC}.toc_results outcomes on outcomes.toc_result_id = indicator_outcome.toc_result_id diff --git a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicators.repository.ts b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicators.repository.ts index 72edea76f..93be88a5b 100644 --- a/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicators.repository.ts +++ b/onecgiar-pr-server/src/api/contribution-to-indicators/repositories/contribution-to-indicators.repository.ts @@ -122,21 +122,18 @@ export class ContributionToIndicatorsRepository extends Repository Date: Mon, 16 Dec 2024 09:50:24 -0500 Subject: [PATCH 7/7] =?UTF-8?q?=E2=99=BB=EF=B8=8Frefactor(Results):=20typi?= =?UTF-8?q?ng=20array=20on=20query?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- onecgiar-pr-server/src/api/results/result.repository.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onecgiar-pr-server/src/api/results/result.repository.ts b/onecgiar-pr-server/src/api/results/result.repository.ts index 73f1e202c..e829ab9ae 100644 --- a/onecgiar-pr-server/src/api/results/result.repository.ts +++ b/onecgiar-pr-server/src/api/results/result.repository.ts @@ -544,7 +544,9 @@ WHERE try { const results = await this.query( queryData, - ([userid] as any[]).concat(initiativeCode ? [initiativeCode] : []), + ([userid] as (string | number)[]).concat( + initiativeCode ? [initiativeCode] : [], + ), ); return results; } catch (error) {