2020-02-14 02:23:21 +00:00
|
|
|
const updateNote = ( operations ) => ( noteId, noteFields ) => {
|
2019-03-12 13:13:20 +00:00
|
|
|
const resourceKey = 'note';
|
2020-02-14 02:23:21 +00:00
|
|
|
operations.update( [ resourceKey ], {
|
|
|
|
[ resourceKey ]: { noteId, ...noteFields },
|
|
|
|
} );
|
2019-03-12 13:13:20 +00:00
|
|
|
};
|
|
|
|
|
2020-02-14 02:23:21 +00:00
|
|
|
const triggerNoteAction = ( operations ) => ( noteId, actionId ) => {
|
2019-05-24 20:22:46 +00:00
|
|
|
const resourceKey = 'note-action';
|
2020-02-14 02:23:21 +00:00
|
|
|
operations.update( [ resourceKey ], {
|
|
|
|
[ resourceKey ]: { noteId, actionId },
|
|
|
|
} );
|
2019-05-24 20:22:46 +00:00
|
|
|
};
|
|
|
|
|
2019-03-12 13:13:20 +00:00
|
|
|
export default {
|
|
|
|
updateNote,
|
2019-05-24 20:22:46 +00:00
|
|
|
triggerNoteAction,
|
2019-03-12 13:13:20 +00:00
|
|
|
};
|