aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-29 22:54:18 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-29 22:54:18 -0600
commit7d513ea7f0df7e295f8fd8ebe5d202530199f924 (patch)
treed00edef59401bab195b5722fd0d51bdd06f76a9d /src/api
parentac0d9f421f1304306d9b3a264a225966fa9d5677 (diff)
downloadToDo-App-FE-1.0.0.tar.gz
ToDo-App-FE-1.0.0.zip
New Average time added.v1.0.0dev
It displays the time in average of completing to dos.
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);
+ }
+ };
+}