From ee859a16819a5bfc288c526d71934d8f3b1824df Mon Sep 17 00:00:00 2001 From: Hector Molano Date: Thu, 2 Nov 2023 12:41:49 +0100 Subject: [PATCH] Revert "add list requisitions" --- requisitions.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/requisitions.go b/requisitions.go index 291bb05..e87118c 100644 --- a/requisitions.go +++ b/requisitions.go @@ -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 -}