diff --git a/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.actions.js b/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.actions.js index 68d632fbb8..144bf0902e 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.actions.js +++ b/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.actions.js @@ -18,11 +18,11 @@ export const batchActionTypes = { export const requestAddNoteForEnrollment = (enrollmentId: string, note: string) => actionCreator(actionTypes.REQUEST_ADD_NOTE_FOR_ENROLLMENT)({ enrollmentId, note }); -export const startAddNoteForEnrollment = (enrollmentId: string, serverData: Object, selections: Object, context: Object) => +export const startAddNoteForEnrollment = (enrollmentUid: string, serverData: Object, selections: Object, context: Object) => actionCreator(actionTypes.START_ADD_NOTE_FOR_ENROLLMENT)({ selections, context }, { offline: { effect: { - url: `enrollments/${enrollmentId}/note`, + url: `tracker/enrollments/${enrollmentUid}/note`, method: effectMethods.POST, data: serverData, }, @@ -31,5 +31,5 @@ export const startAddNoteForEnrollment = (enrollmentId: string, serverData: Obje }, }); -export const addEnrollmentNote = (enrollmentId: string, note: Object) => - actionCreator(actionTypes.ADD_ENROLLMENT_NOTE)({ enrollmentId, note }); +export const addEnrollmentNote = (enrollmentUid: string, note: Object) => + actionCreator(actionTypes.ADD_ENROLLMENT_NOTE)({ enrollmentUid, note }); diff --git a/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.epics.js b/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.epics.js index ef60ee39b0..9fa7ed1c1b 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.epics.js +++ b/src/core_modules/capture-core/components/WidgetEnrollmentNote/WidgetEnrollmentNote.epics.js @@ -23,7 +23,7 @@ export const addNoteForEnrollmentEpic = (action$: InputObservable, store: ReduxS const clientId = uuid(); const serverData = { - notes: [{ value: note }], + value: note, }; const clientNote = { diff --git a/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.actions.js b/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.actions.js index 1bced30837..4de6d431d3 100644 --- a/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.actions.js +++ b/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.actions.js @@ -17,11 +17,11 @@ export const batchActionTypes = { export const requestAddNoteForEvent = (itemId: string, dataEntryId: string, note: string) => actionCreator(actionTypes.REQUEST_ADD_NOTE_FOR_EVENT)({ itemId, dataEntryId, note }); -export const startAddNoteForEvent = (eventId: string, serverData: Object, selections: Object, context: Object) => +export const startAddNoteForEvent = (eventUid: string, serverData: Object, selections: Object, context: Object) => actionCreator(actionTypes.START_ADD_NOTE_FOR_EVENT)({ selections, context }, { offline: { effect: { - url: `events/${eventId}/note`, + url: `/tracker/events/${eventUid}/note`, method: effectMethods.POST, data: serverData, }, diff --git a/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.epics.js b/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.epics.js index 1bcd33222e..98b29a0047 100644 --- a/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.epics.js +++ b/src/core_modules/capture-core/components/WidgetEventNote/WidgetEventNote.epics.js @@ -36,7 +36,7 @@ export const addNoteForEventEpic = (action$: InputObservable, store: ReduxStore, const serverData = { event: eventId, - notes: [{ value: payload.note }], + value: payload.note, }; const clientNote = {