From ccd0d4828f44ccb7936b2237d62aafed521466f1 Mon Sep 17 00:00:00 2001 From: Markus Bekken Date: Mon, 22 Feb 2021 14:32:36 +0100 Subject: [PATCH] fix: [DHIS2-10548] remove hard coded ouMode and unused code (#972) --- scripts/services.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/scripts/services.js b/scripts/services.js index 973129d85..90b00f374 100644 --- a/scripts/services.js +++ b/scripts/services.js @@ -688,29 +688,8 @@ var trackerCaptureServices = angular.module('trackerCaptureServices', ['ngResour return null; }); }, - getByEntity: function( entity ){ - var promise = $http.get( DHIS2URL + '/enrollments.json?ouMode=ACCESSIBLE&trackedEntityInstance=' + entity + '&fields=:all&paging=false').then(function(response){ - return convertFromApiToUser(response.data); - },function(response){ - var errorBody = $translate.instant('failed_to_fetch_enrollment'); - NotificationService.showNotifcationDialog(errorHeader, errorBody, response); - return null; - }); - return promise; - }, - getByEntityAndProgram: function( entity, program ){ - var url = DHIS2URL + '/enrollments.json?ouMode=ACCESSIBLE&trackedEntityInstance=' + entity + '&program=' + program + '&fields=:all&paging=false'; - var promise = TeiAccessApiService.get(entity,program,url).then(function(response){ - return convertFromApiToUser(response.data); - }, function(response){ - var errorBody = $translate.instant('failed_to_fetch_enrollment'); - NotificationService.showNotifcationDialog(errorHeader, errorBody, response); - return null; - }); - return promise; - }, getByStartAndEndDate: function( program, orgUnit, ouMode, startDate, endDate ){ - var promise = $http.get( DHIS2URL + '/enrollments.json?ouMode=ACCESSIBLE&program=' + program + '&orgUnit=' + orgUnit + '&ouMode='+ ouMode + '&startDate=' + startDate + '&endDate=' + endDate + '&fields=:all&paging=false').then(function(response){ + var promise = $http.get( DHIS2URL + '/enrollments.json?program=' + program + '&ou=' + orgUnit + '&ouMode='+ ouMode + '&startDate=' + startDate + '&endDate=' + endDate + '&fields=:all&paging=false').then(function(response){ return convertFromApiToUser(response.data); }, function(response){ var errorBody = $translate.instant('failed_to_fetch_enrollment');