Testaustime / testaustime-backend

https://api.testaustime.fi
MIT License
12 stars 11 forks source link

Better error if a user doesn't have a current activity #65

Closed Eldemarkki closed 1 year ago

Eldemarkki commented 1 year ago

If a user doesn't have a current activity, but their current activity is requested at /users/USERNAME/activity/current, it will just return null with status 200.

$ curl 'https://api.testaustime.fi/users/Antti/activity/current' -H 'Authorization: Bearer REDACTED'
null

(sorry Antti for exposing your inactivity)

I suggest we return some JSON (e.g. {"error":"User doesn't have an active session"}) with status code 404.

lajp commented 1 year ago

Ok, will do :)