diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/axios_methods.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/api/axios_methods.js b/src/api/axios_methods.js index c68cc21..68f119f 100644 --- a/src/api/axios_methods.js +++ b/src/api/axios_methods.js @@ -30,3 +30,20 @@ export function new_todo_function() { } }; } + +// editToDo() on BE. +export function edit_todo_function() { + // Edit an existing to do. + // PUT "/todos/{id}" + return async (data) => { + try { + await api.put(`/todos/${data.id}`, { + text: data.text, + dueDate: data.due_date, + priority: data.priority, + }); + } catch (err) { + console.log(err); + } + }; +} |