aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-27 14:16:12 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-27 14:16:12 -0600
commite04bff29bf8146bb709a76fc187e0683065e4f03 (patch)
treeacb7a81dd4d362f3bdac09e0d3e5723d413a5c67 /src/api
parent5fc5f300463f606c948ec10fc5554e3c60a8ec36 (diff)
downloadToDo-App-FE-e04bff29bf8146bb709a76fc187e0683065e4f03.tar.gz
ToDo-App-FE-e04bff29bf8146bb709a76fc187e0683065e4f03.zip
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.
Diffstat (limited to '')
-rw-r--r--src/api/axios_methods.js8
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);
}