Skip to content

Commit

Permalink
Merge pull request #18 from frieser/revert-17-patch-1
Browse files Browse the repository at this point in the history
Revert "add list requisitions"
  • Loading branch information
frieser authored Nov 2, 2023
2 parents 7764f60 + ee859a1 commit 15f00dc
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions requisitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,34 +100,3 @@ func (c Client) GetRequisition(id string) (r Requisition, err error) {

return r, nil
}

func (c Client) ListRequisitions() (r []Requisition, err error) {
req := http.Request{
Method: http.MethodGet,
URL: &url.URL{
Path: strings.Join([]string{requisitionsPath, ""}, "/"),
},
}
resp, err := c.c.Do(&req)

if err != nil {
return nil, err
}
body, err := ioutil.ReadAll(resp.Body)

if err != nil {
return nil, err
}

if resp.StatusCode != http.StatusOK {
return nil, &APIError{resp.StatusCode, string(body), err}
}

list := make([]Requisition, 0)
err = json.Unmarshal(body, &list)
if err != nil {
return nil, err
}

return list, nil
}

0 comments on commit 15f00dc

Please sign in to comment.