diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-29 22:54:18 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-29 22:54:18 -0600 |
commit | 7d513ea7f0df7e295f8fd8ebe5d202530199f924 (patch) | |
tree | d00edef59401bab195b5722fd0d51bdd06f76a9d /src/api/axios_methods.js | |
parent | ac0d9f421f1304306d9b3a264a225966fa9d5677 (diff) | |
download | ToDo-App-FE-1.0.0.tar.gz ToDo-App-FE-1.0.0.zip |
It displays the time in average of completing to dos.
Diffstat (limited to 'src/api/axios_methods.js')
-rw-r--r-- | src/api/axios_methods.js | 14 |
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); + } + }; +} |