From d48c8b1d5dca22f3893f05c1cc8d26ae2a21d6ce Mon Sep 17 00:00:00 2001 From: Allan Nava Date: Thu, 16 Nov 2023 17:00:37 +0100 Subject: [PATCH] update categories method --- compress/api_category.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compress/api_category.go b/compress/api_category.go index 6e84221..30d2ade 100644 --- a/compress/api_category.go +++ b/compress/api_category.go @@ -27,10 +27,14 @@ func (o *compress) GetCategories() ([]Category, error) { } o.debugPrint(resp) if resp.IsError() { - return nil, fmt.Errorf("") + return nil, fmt.Errorf("categories error") + } + var obj []Category + if err := json.Unmarshal(resp.Body(), &obj); err != nil { + return nil, err } // - return nil, nil + return resp, nil } /**