diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/toglx.ex | 11 | ||||
-rw-r--r-- | lib/toglx/escript.ex | 5 |
2 files changed, 16 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 diff --git a/lib/toglx/escript.ex b/lib/toglx/escript.ex index a50c5b1..a3b68cc 100644 --- a/lib/toglx/escript.ex +++ b/lib/toglx/escript.ex @@ -20,4 +20,9 @@ defmodule Toglx.Escript do |> IO.inspect end + def run(%{cmd: "continue"}) do + Toglx.submit_continue_event + |> IO.inspect + end + end |