diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-27 15:32:54 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-27 15:32:54 -0600 |
commit | ac4a146682ede7bf661938b78a970d7da8bd868a (patch) | |
tree | 30020143572191ab723772c0b0b0eea83612268b /src/api | |
parent | c8fd1b88958ad0a5cd9b87395f9995f0f4176a30 (diff) | |
download | ToDo-App-FE-ac4a146682ede7bf661938b78a970d7da8bd868a.tar.gz ToDo-App-FE-ac4a146682ede7bf661938b78a970d7da8bd868a.zip |
Delete a specific to do with API.
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/axios_methods.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/api/axios_methods.js b/src/api/axios_methods.js index 68f119f..8748cb7 100644 --- a/src/api/axios_methods.js +++ b/src/api/axios_methods.js @@ -47,3 +47,16 @@ export function edit_todo_function() { } }; } + +// removeToDo(). +export function remove_todo_function() { + // Remove an existing to do by its id. + // DELETE "/todos/{id}" + return async (data) => { + try { + await api.delete(`/todos/${data.id}`); + } catch (err) { + console.log(err); + } + }; +} |