mirror of
https://github.com/kovetskiy/mark.git
synced 2026-04-19 04:31:11 +00:00
fix context for cloud confluence
This commit is contained in:
@@ -61,6 +61,7 @@ type AttachmentInfo struct {
|
||||
Comment string `json:"comment"`
|
||||
} `json:"metadata"`
|
||||
Links struct {
|
||||
Context string `json:"context"`
|
||||
Download string `json:"download"`
|
||||
} `json:"_links"`
|
||||
}
|
||||
@@ -320,6 +321,9 @@ func getAttachmentPayload(name, comment, path string) (*form, error) {
|
||||
|
||||
func (api *API) GetAttachments(pageID string) ([]AttachmentInfo, error) {
|
||||
result := struct {
|
||||
Links struct {
|
||||
Context string `json:"context"`
|
||||
} `json:"_links"`
|
||||
Results []AttachmentInfo `json:"results"`
|
||||
}{}
|
||||
|
||||
@@ -338,6 +342,14 @@ func (api *API) GetAttachments(pageID string) ([]AttachmentInfo, error) {
|
||||
return nil, newErrorStatusNotOK(request)
|
||||
}
|
||||
|
||||
for i, info := range result.Results {
|
||||
if info.Links.Context == "" {
|
||||
info.Links.Context = result.Links.Context
|
||||
}
|
||||
|
||||
result.Results[i] = info
|
||||
}
|
||||
|
||||
return result.Results, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user