LiquidPlanner Classic Forum

Ask a Question
Back to All

RFE: path to current timer

Posted on behalf of Ricardo Signes. Original posting date 2014-08-20.

API methods for dealing with a timer look like this:

/api/workspaces/:id/tasks/:task_id/timer/commit

This means that to implement a feature like "stop the current timer" or "commit work on current timer" there are two API calls required:

API: get all timers
LOCAL: find the timer, among those, that is running
API: make API call using the timer's task_id
I suggest that there be a path like this:

/api/workspaces/:id/user/:userid/current_timer

...and that the endpoints found on any given timer also be found here. They should, of course, return 4xx codes when there is no current timer.

Note that I have included the userid. Right now, the API does not allow one to interact in any way with the timers of a non-self user. I think this is a real shortcoming. If it is ever addressed, having current_timer under the userid will mean that there is an obvious way to get the API of a non-self user (which for now can just issue Forbidden).