← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21153: tracker-capture: comment saving to enrollment now uses new end point

 

------------------------------------------------------------
revno: 21153
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-11-21 12:27:43 +0100
message:
  tracker-capture: comment saving to enrollment now uses new end point
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-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-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2015-08-06 15:06:48 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2015-11-21 11:27:43 +0000
@@ -65,7 +65,7 @@
             var e = angular.copy($scope.selectedEnrollment);
 
             e.notes = [newNote];
-            EnrollmentService.update(e).then(function(){
+            EnrollmentService.updateForNote(e).then(function(){
                 $scope.note = '';
                 $scope.addNoteField = false; //note is added, hence no need to show note field.                
             });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-11-17 13:20:40 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-11-21 11:27:43 +0000
@@ -560,6 +560,12 @@
             });
             return promise;
         },
+        updateForNote: function( enrollment ){
+            var promise = $http.put('../api/enrollments/' + enrollment.enrollment + '/addNote', enrollment).then(function(response){
+                return response.data;         
+            });
+            return promise;
+        },
         cancel: function(enrollment){
             var promise = $http.put('../api/enrollments/' + enrollment.enrollment + '/cancelled').then(function(response){
                 return response.data;