From 758cf0bf7e899acee89ee4b8a39c5565622aee31 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Jun 2017 12:42:35 +0200 Subject: http.go: Replace `SubmitTimeEntries` with `SubmitTimeEntry` A slightly altered function that only submits a single time entry and uses our new `Profile`, `Project`, and `TimeEntry` types. --- timetask/http.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'timetask') diff --git a/timetask/http.go b/timetask/http.go index 8b90230..76bfdc3 100644 --- a/timetask/http.go +++ b/timetask/http.go @@ -37,13 +37,11 @@ func Login(username, password string) (resp *http.Response, err error) { } func SubmitTimeEntry( + profile Profile, project Project, time_entry TimeEntry, ) (resp *http.Response, err error) { -} - -func SubmitTimeEntries(fields Fields, time_entries []TimeEntry) (resp *http.Response, err error) { - v := buildSubmissionParams(fields, time_entries) + v := buildSubmissionParams(profile, time_entry) v.Set("module", "time") v.Set("action", "submitmultipletime") @@ -51,6 +49,7 @@ func SubmitTimeEntries(fields Fields, time_entries []TimeEntry) (resp *http.Resp return nil, nil } + func buildSubmissionParams(profile Profile, time_entry TimeEntry) url.Values { v := url.Values{} -- cgit v1.2.3