aboutsummaryrefslogblamecommitdiff
path: root/src/api/axios_methods.js
blob: b9e40dc061b42fb39a303ed26034b321113e181d (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                 
                                      

                                
                               
             

                                                     




                             
import api from "./axios_config";

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