Skip to content

Commit

Permalink
fix: new note endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Dec 14, 2024
1 parent be9cef9 commit e9181ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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 });
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const addNoteForEnrollmentEpic = (action$: InputObservable, store: ReduxS
const clientId = uuid();

const serverData = {
notes: [{ value: note }],
value: note,
};

const clientNote = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const addNoteForEventEpic = (action$: InputObservable, store: ReduxStore,

const serverData = {
event: eventId,
notes: [{ value: payload.note }],
value: payload.note,
};

const clientNote = {
Expand Down

0 comments on commit e9181ef

Please sign in to comment.