diff options
| author | Teddy Wing | 2017-06-03 12:42:35 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-06-03 12:42:35 +0200 | 
| commit | 758cf0bf7e899acee89ee4b8a39c5565622aee31 (patch) | |
| tree | 4f4d14b68c09f59b57a2d9f03d2c397a5d48c765 | |
| parent | 1576d4111d412a1c501b6a8630c4d559302b9b21 (diff) | |
| download | timetasker-758cf0bf7e899acee89ee4b8a39c5565622aee31.tar.bz2 | |
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.
| -rw-r--r-- | timetask/http.go | 7 | 
1 files changed, 3 insertions, 4 deletions
| 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{} | 
