aboutsummaryrefslogtreecommitdiff
path: root/src/api/axios_methods.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api/axios_methods.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/api/axios_methods.js b/src/api/axios_methods.js
new file mode 100644
index 0000000..2e2329f
--- /dev/null
+++ b/src/api/axios_methods.js
@@ -0,0 +1,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);
+ }
+ };
+}