diff options
author | kballou <kballou@devnulllabs.io> | 2016-06-21 11:54:01 -0600 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2016-06-21 11:54:01 -0600 |
commit | e2e85299bcae58cdf9c6039824a89d0cca0f65ae (patch) | |
tree | 96d18779e3cda40b0b892fd10ca52b7e3a1fb389 /lib/toglx.ex | |
parent | 77e4e8647d565218bfc72fbe569eb7eb00c4d8e6 (diff) | |
download | toglx-e2e85299bcae58cdf9c6039824a89d0cca0f65ae.tar.gz toglx-e2e85299bcae58cdf9c6039824a89d0cca0f65ae.tar.xz |
Add continue command to continue last entry
This will only start a new entry if there is currently no running/tracking
entry.
Diffstat (limited to 'lib/toglx.ex')
-rw-r--r-- | lib/toglx.ex | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/toglx.ex b/lib/toglx.ex index 9bb086c..63bbcdd 100644 --- a/lib/toglx.ex +++ b/lib/toglx.ex @@ -33,6 +33,17 @@ defmodule Toglx do end end + def submit_continue_event do + case current do + %{data: nil} -> list |> List.last |> continue + _ -> :ok + end + end + + defp continue(%{description: task_name}) do + submit_start_event(task_name) + end + def current do create_togglex_client |> Togglex.Api.TimeEntries.current |