diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-02-24 06:15:13 -0500 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-02-24 11:15:13 +0000 |
commit | ace228c4e52bd25dca24d1a5b35eff97740e5ea2 (patch) | |
tree | ddf37fe056dc62ad1e70009f538a36961d666b3f /model | |
parent | 80273d02347a3ac35ba2566151b53e8a420e2d0a (diff) | |
download | chat-ace228c4e52bd25dca24d1a5b35eff97740e5ea2.tar.gz chat-ace228c4e52bd25dca24d1a5b35eff97740e5ea2.tar.bz2 chat-ace228c4e52bd25dca24d1a5b35eff97740e5ea2.zip |
Implement GET /posts/{post_id}/files/info endpoint for APIv4 (#5519)
Diffstat (limited to 'model')
-rw-r--r-- | model/client4.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 1e4ba86ac..6b9a389c9 100644 --- a/model/client4.go +++ b/model/client4.go @@ -783,6 +783,16 @@ func (c *Client4) GetFile(fileId string) ([]byte, *Response) { } } +// GetFileInfosForPost gets all the file info objects attached to a post. +func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response) { + if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/files/info", etag); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return FileInfosFromJson(r.Body), BuildResponse(r) + } +} + // General Section // GetPing will ping the server and to see if it is up and running. |