mujx / hakatime

Wakatime server implementation & analytics dashboard
https://hakatime.mtx-dev.xyz
The Unlicense
643 stars 49 forks source link

API Stats implementation not accepting time ranges #88

Open daniel-naegele opened 1 year ago

daniel-naegele commented 1 year ago

When trying out the following project https://github.com/athul/waka-readme I came across the issue, that the following API is not implemented: hakatime | 141.52.248.4 - - [15/Sep/2023:13:14:57 +0000] "GET /api/v1/users/current/stats/last_7_days HTTP/1.1" 404 - ...

The Wakatime API suggests, that last_7_days is a valid request, but the server is not properly handling it. I could help implement the bug fix/implementation as a good first issue, but will need a bit of help to know where to fix it.

mujx commented 1 year ago

Hi @daniel-naegele, thanks for your interest in the project. This seems like a missing feature because currently that endpoint only accepts query paramters.

This is the relevant piece of code that handle those requests: https://github.com/mujx/hakatime/blob/063fb08c1f346c935e317b2d31d8626791a30a60/src/Haka/Handlers/Stats.hs#L260 and it could be updated to handle also an extra path parameter.

Falci commented 8 months ago

I had the same issue when I tried to switch from wakatime to hakatime as provider for waka-readme.