aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api/axios_methods.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api/axios_methods.js b/src/api/axios_methods.js
index ffc0c28..f983157 100644
--- a/src/api/axios_methods.js
+++ b/src/api/axios_methods.js
@@ -86,3 +86,17 @@ export function set_undone_function() {
}
};
}
+
+// giveMeLastID().
+export function get_last_id_function() {
+ // Retrieve last index used.
+ // GET "/todos/lastIndex"
+ return async (handler) => {
+ try {
+ const response = await api.get("/todos/lastIndex");
+ handler(response.data);
+ } catch (err) {
+ console.log(err);
+ }
+ };
+}