From e04bff29bf8146bb709a76fc187e0683065e4f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Sat, 27 May 2023 14:16:12 -0600 Subject: List of to dos is initialized on database. At the beginning, the app will fetch the to dos from the back end and write all of them on Redux. --- src/api/axios_methods.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/api/axios_methods.js') 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); } -- cgit v1.2.3