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 bea8b79..90e8a03 100644
--- a/src/api/axios_methods.js
+++ b/src/api/axios_methods.js
@@ -149,3 +149,17 @@ export function get_last_id_function() {
}
};
}
+
+// getAverageTime().
+export function get_average_time_function() {
+ // Retrieve the average time to complete the to dos, given a priority.
+ // GET "/todos/average/{priority}"
+ return async (handler, priority) => {
+ try {
+ const response = await api.get(`/todos/average/${priority}`);
+ handler(response.data);
+ } catch (err) {
+ console.log(err);
+ }
+ };
+}