dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30049
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15241: Event capture. Fixed issue with pager sometimes being undefined. Made service more robust by chec...
------------------------------------------------------------
revno: 15241
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-05-12 19:25:52 +0200
message:
Event capture. Fixed issue with pager sometimes being undefined. Made service more robust by checking whether pager is defined and falling back to default values.
modified:
dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js 2014-04-18 17:56:57 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js 2014-05-12 17:25:52 +0000
@@ -89,7 +89,9 @@
return {
getByStage: function(orgUnit, programStage, pager){
- var url = '../api/events.json?' + 'orgUnit=' + orgUnit + '&programStage=' + programStage + '&pageSize=' + pager.pageSize + '&page=' + pager.page;
+ var pgSize = pager ? pager.pageSize : 50;
+ var pg = pager ? pager.page : 1;
+ var url = '../api/events.json?' + 'orgUnit=' + orgUnit + '&programStage=' + programStage + '&pageSize=' + pgSize + '&page=' + pg;
var promise = $http.get( url ).then(function(response){
return response.data;