diff options
Diffstat (limited to 'src/api/axios_methods.js')
-rw-r--r-- | src/api/axios_methods.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/axios_methods.js b/src/api/axios_methods.js index 2e2329f..b9e40dc 100644 --- a/src/api/axios_methods.js +++ b/src/api/axios_methods.js @@ -1,13 +1,13 @@ import api from "./axios_config"; // findAll() on Back End. -export function get_todos_function(hook) { +export function get_todos_function() { // Get a list of all to dos. // GET "/v1/todos" - return async () => { + return async (handler) => { try { - const response = await api.get("/v1/todos"); - hook(response.data); + const response = await api.get("/todos"); + handler(response.data); } catch (err) { console.log(err); } |