Skip to content

Commit

Permalink
fix: edit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
9sneha-n committed Nov 25, 2024
1 parent e3ae1e5 commit b1a1a21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/data/repositories/SurveyFormD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export class SurveyD2Repository implements SurveyRepository {
//If event specified,populate the form
if (eventId) {
if (isTrackerProgram(programId)) {
if (!orgUnitId) return Future.error(new Error("Survey not found"));
if (!orgUnitId && programId !== PPS_PATIENT_REGISTER_ID)
return Future.error(new Error("Survey not found"));
return this.getTrackerProgramById(eventId, programId).flatMap(
trackedEntity => {
if (resp.programs[0] && trackedEntity) {
Expand Down Expand Up @@ -326,7 +327,7 @@ export class SurveyD2Repository implements SurveyRepository {
programId: Id,
orgUnitId: Id | undefined
): FutureData<Questionnaire> {
if (isTrackerProgram(programId) && !orgUnitId)
if (isTrackerProgram(programId) && !orgUnitId && programId !== PPS_PATIENT_REGISTER_ID)
return Future.error(new Error("Unable to find survey"));
return this.getForm(programId, eventId, orgUnitId);
}
Expand Down

0 comments on commit b1a1a21

Please sign in to comment.