From a21d8611d0b5b6cf9d8c9655be3e9c5956961ff8 Mon Sep 17 00:00:00 2001 From: Mustansir Muzaffar Date: Fri, 3 Oct 2025 16:08:27 +0500 Subject: [PATCH 1/3] add content query params to GetComments and GetAttachments --- content.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content.go b/content.go index ad078c9..2fce943 100644 --- a/content.go +++ b/content.go @@ -236,20 +236,22 @@ func (a *API) GetChildPages(id string) (*Search, error) { } // GetComments returns a list of comments belonging to id -func (a *API) GetComments(id string) (*Search, error) { +func (a *API) GetComments(id string, query ContentQuery) (*Search, error) { ep, err := a.getContentChildEndpoint(id, "comment") if err != nil { return nil, err } + ep.RawQuery = addContentQueryParams(query).Encode() return a.SendSearchRequest(ep, "GET") } // GetAttachments returns a list of attachments belonging to id -func (a *API) GetAttachments(id string) (*Search, error) { +func (a *API) GetAttachments(id string, query ContentQuery) (*Search, error) { ep, err := a.getContentChildEndpoint(id, "attachment") if err != nil { return nil, err } + ep.RawQuery = addContentQueryParams(query).Encode() return a.SendSearchRequest(ep, "GET") } From 6f1d38d9450b3a568d72253ff6d398136ad7aeed Mon Sep 17 00:00:00 2001 From: Mustansir Muzaffar Date: Fri, 3 Oct 2025 16:11:50 +0500 Subject: [PATCH 2/3] fix tests --- content_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content_test.go b/content_test.go index 8d31402..df11f27 100644 --- a/content_test.go +++ b/content_test.go @@ -47,11 +47,11 @@ func TestContentGetter(t *testing.T) { assert.Nil(t, err) assert.Equal(t, &Search{}, p) - p, err = api.GetComments("42") + p, err = api.GetComments("42", ContentQuery{}) assert.Nil(t, err) assert.Equal(t, &Search{}, p) - p, err = api.GetAttachments("42") + p, err = api.GetAttachments("42", ContentQuery{}) assert.Nil(t, err) assert.Equal(t, &Search{}, p) From 8f887378a2d06a4362ede84f9d04b8159f868140 Mon Sep 17 00:00:00 2001 From: Mustansir Muzaffar Date: Fri, 3 Oct 2025 16:12:55 +0500 Subject: [PATCH 3/3] fix examples --- examples/attributes/attributes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/attributes/attributes.go b/examples/attributes/attributes.go index e97bddf..e5b5010 100644 --- a/examples/attributes/attributes.go +++ b/examples/attributes/attributes.go @@ -14,7 +14,7 @@ func main() { } // get comments of a specific page - res, err := api.GetComments("1234567") + res, err := api.GetComments("1234567", goconfluence.ContentQuery{}) if err != nil { log.Fatal(err) } @@ -24,7 +24,7 @@ func main() { } // get attachments of a specific page - res, err = api.GetAttachments("1234567") + res, err = api.GetAttachments("1234567", goconfluence.ContentQuery{}) if err != nil { log.Fatal(err) }