From 42f59d6a6772eba951aae5c84b8009d87bdc86da Mon Sep 17 00:00:00 2001 From: Kavitha S Date: Thu, 10 Oct 2024 00:37:03 +0530 Subject: [PATCH] fix update notes api call --- ui/app/ot/controller/otCalendarController.js | 2 +- ui/app/ot/services/surgicalAppointmentService.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/app/ot/controller/otCalendarController.js b/ui/app/ot/controller/otCalendarController.js index 6dff3bab0f..1e3794fb02 100644 --- a/ui/app/ot/controller/otCalendarController.js +++ b/ui/app/ot/controller/otCalendarController.js @@ -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}); }; diff --git a/ui/app/ot/services/surgicalAppointmentService.js b/ui/app/ot/services/surgicalAppointmentService.js index 4837083637..b8c9fb15aa 100644 --- a/ui/app/ot/services/surgicalAppointmentService.js +++ b/ui/app/ot/services/surgicalAppointmentService.js @@ -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);