From 27fc4ea78f299c9ccb961c5e14b922af51a2225c Mon Sep 17 00:00:00 2001 From: Jim Myers Date: Mon, 10 May 2021 12:50:24 -0400 Subject: [PATCH] fix query params on tags --- tag.go | 2 +- tag_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tag.go b/tag.go index 011ab1f5..a0448724 100644 --- a/tag.go +++ b/tag.go @@ -358,7 +358,7 @@ func getTagList(ctx context.Context, c *Client, entityType, entityID string, o L } // Make call to get all pages associated with the base endpoint. - if err := c.pagedGet(ctx, path+queryParms.Encode(), responseHandler); err != nil { + if err := c.pagedGet(ctx, path+"?"+queryParms.Encode(), responseHandler); err != nil { return nil, err } diff --git a/tag_test.go b/tag_test.go index 08b7f64d..ea11c3d3 100644 --- a/tag_test.go +++ b/tag_test.go @@ -12,6 +12,7 @@ func TestTag_List(t *testing.T) { mux.HandleFunc("/tags/", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") + testEqual(t, r.URL.Query()["query"], []string{"MyTag"}) _, _ = w.Write([]byte(`{"tags": [{"id": "1","label":"MyTag"}]}`)) }) @@ -19,6 +20,7 @@ func TestTag_List(t *testing.T) { client := &Client{apiEndpoint: server.URL, authToken: "foo", HTTPClient: defaultHTTPClient} opts := ListTagOptions{ APIListObject: listObj, + Query: "MyTag", } res, err := client.ListTags(opts) if err != nil {