Skip to content

Commit

Permalink
fix update notes api call
Browse files Browse the repository at this point in the history
  • Loading branch information
kavitha-sundararajan committed Oct 9, 2024
1 parent 6006e60 commit 42f59d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/app/ot/controller/otCalendarController.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ angular.module('bahmni.ot')
if ($scope.weekOrDay === "week") {
note = $scope.notesForWeek[$scope.notesStartDate];
}
surgicalAppointmentService.updateNoteForADay(note ? note.noteId : $scope.noteId, $scope.otNotesField);
surgicalAppointmentService.updateNoteForADay(note ? note.noteId : $scope.noteId, $scope.otNotesField, $rootScope.currentProvider ? $rootScope.currentProvider.uuid : null);
$state.go("otScheduling", {viewDate: $scope.viewDate}, {reload: true});
};

Expand Down
9 changes: 7 additions & 2 deletions ui/app/ot/services/surgicalAppointmentService.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,15 @@ angular.module('bahmni.ot')
return $http.post(Bahmni.OT.Constants.notesUrl, payload, headers);
};

this.updateNoteForADay = function (noteId, note) {
this.updateNoteForADay = function (noteId, note, providerUuid) {
const payload = {
providerUuid: providerUuid,
noteText: note
};
const headers = {"Accept": "application/json", "Content-Type": "application/json"};
return $http.post(Bahmni.OT.Constants.notesUrl + "/" + noteId, note, headers);
return $http.post(Bahmni.OT.Constants.notesUrl + "/" + noteId, payload, headers);
};

this.deleteNoteForADay = function (noteId) {
const headers = {"Accept": "application/json", "Content-Type": "application/json", withCredentials: true};
return $http.delete(Bahmni.OT.Constants.notesUrl + "/" + noteId, headers);
Expand Down

0 comments on commit 42f59d6

Please sign in to comment.