aboutsummaryrefslogtreecommitdiff
path: root/src/api/axios_methods.js
blob: 2e2329f22959782ac6317d09e09ce761e0aa48d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import api from "./axios_config";

// findAll() on Back End.
export function get_todos_function(hook) {
    // Get a list of all to dos.
    // GET "/v1/todos"
    return async () => {
        try {
            const response = await api.get("/v1/todos");
            hook(response.data);
        } catch (err) {
            console.log(err);
        }
    };
}