From 4499ed1c096434e293493942a2183f2d555368a9 Mon Sep 17 00:00:00 2001 From: 9sneha-n <9sneha.n@gmail.com> Date: Tue, 10 Sep 2024 16:37:02 +0530 Subject: [PATCH] fix: remove ou filter for populated form --- src/data/repositories/SurveyFormD2Repository.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/data/repositories/SurveyFormD2Repository.ts b/src/data/repositories/SurveyFormD2Repository.ts index bd5f415..26c6c12 100644 --- a/src/data/repositories/SurveyFormD2Repository.ts +++ b/src/data/repositories/SurveyFormD2Repository.ts @@ -111,7 +111,7 @@ export class SurveyD2Repository implements SurveyRepository { if (eventId) { if (isTrackerProgram(programId)) { if (!orgUnitId) return Future.error(new Error("Survey not found")); - return this.getTrackerProgramById(eventId, programId, orgUnitId).flatMap( + return this.getTrackerProgramById(eventId, programId).flatMap( trackedEntity => { if (resp.programs[0] && trackedEntity) { return Future.success( @@ -350,16 +350,15 @@ export class SurveyD2Repository implements SurveyRepository { private getTrackerProgramById( trackedEntityId: Id, - programId: Id, - orgUnitId: Id + programId: Id ): FutureData { return apiToFuture( this.api.tracker.trackedEntities.get({ fields: { attributes: true, enrollments: true, trackedEntity: true, orgUnit: true }, - orgUnit: orgUnitId, program: programId, trackedEntity: trackedEntityId, ouMode: "DESCENDANTS", + enrollmentEnrolledBefore: new Date().toISOString(), }) ).flatMap(resp => { if (resp) return Future.success(resp.instances[0]);