Skip to content

Commit

Permalink
fix: [DHIS2-10548] remove hard coded ouMode and unused code (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekkalizer authored Feb 22, 2021
1 parent 27e81ca commit ccd0d48
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions scripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit ccd0d48

Please sign in to comment.