From 0e07e25d8775ad11fbd5bc98b35170522c2ceddc Mon Sep 17 00:00:00 2001 From: Damian Orzepowski Date: Wed, 20 Dec 2023 11:21:30 +0100 Subject: [PATCH] fix(BUX-408): admin query requests are failing because of nil reference and invalid http method --- buxclient.go | 2 ++ transports/http_admin.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/buxclient.go b/buxclient.go index 9996071..ede544d 100644 --- a/buxclient.go +++ b/buxclient.go @@ -90,6 +90,8 @@ func New(opts ...ClientOps) (*BuxClient, error) { return nil, err } + client.TransportService = client.transport + return client, nil } diff --git a/transports/http_admin.go b/transports/http_admin.go index c80ef89..90eb878 100644 --- a/transports/http_admin.go +++ b/transports/http_admin.go @@ -303,7 +303,7 @@ func (h *TransportHTTP) adminCount(ctx context.Context, conditions map[string]in var count int64 if err := h.doHTTPRequest( - ctx, http.MethodGet, path, jsonStr, h.xPriv, true, &count, + ctx, http.MethodPost, path, jsonStr, h.xPriv, true, &count, ); err != nil { return 0, err }