Skip to content

Commit

Permalink
Merge pull request #11 from upwork/v1.3.4
Browse files Browse the repository at this point in the history
v1.3.4
  • Loading branch information
mnovozhylov authored Sep 30, 2020
2 parents 3ece9c4 + 33b7cc3 commit c8aa77f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.4
* Fix query string issue in Client
* Fix Time Reports API for Freelancer

## 1.3.3
* Send Message to a Batch of Rooms API

Expand Down
8 changes: 7 additions & 1 deletion api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,14 @@ func (c *ApiClient) Get(uri string, params map[string]string) (resp *http.Respon

// https://github.com/mrjones/oauth/issues/34
encQuery := strings.Replace(u.String(), ";", "%3B", -1)
encQuery = strings.Replace(encQuery, "./", "?", 1) // see URL.String method to understand when "./" is returned

response, err := c.oclient.Get(formatUri(uri, c.ep) + strings.Replace(encQuery, "./", "?", 1))
// non-empty string may miss "?"
if encQuery[:1] != "?" {
encQuery = "?" + encQuery
}

response, err := c.oclient.Get(formatUri(uri, c.ep) + encQuery)

return formatResponse(response, err)
}
Expand Down
4 changes: 2 additions & 2 deletions api/routers/reports/time/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ func (r a) GetByCompany(company string, params map[string]string) (*http.Respons
}

// Generating Freelancer's Specific Reports (with financial info)
func (r a) GetByFreelancerFull(freelancerId string, agency string, params map[string]string) (*http.Response, []byte) {
func (r a) GetByFreelancerFull(freelancerId string, params map[string]string) (*http.Response, []byte) {
return r.client.Get("/timereports/v1/providers/" + freelancerId, params)
}

// Generating Freelancer's Specific Reports (hide financial info)
func (r a) GetByFreelancerLimited(freelancerId string, agency string, params map[string]string) (*http.Response, []byte) {
func (r a) GetByFreelancerLimited(freelancerId string, params map[string]string) (*http.Response, []byte) {
return r.client.Get("/timereports/v1/providers/" + freelancerId + "/hours", params)
}

Expand Down

0 comments on commit c8aa77f

Please sign in to comment.