diff options
author | 2021-05-10 16:29:05 +0200 | |
---|---|---|
committer | 2021-05-10 16:29:05 +0200 | |
commit | 742f985d5b0620ad14015f9a2df9940edc254bf4 (patch) | |
tree | 5c8d469fd015efc6f8459f2d9df04132877285a3 /internal/api/client/media/media.go | |
parent | Webfinger + Small fixes (#20) (diff) | |
download | gotosocial-742f985d5b0620ad14015f9a2df9940edc254bf4.tar.xz |
Mediahandler (#21)
Media GET and media PUT handlers
Diffstat (limited to 'internal/api/client/media/media.go')
-rw-r--r-- | internal/api/client/media/media.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/api/client/media/media.go b/internal/api/client/media/media.go index 2826783d6..e45eec7ea 100644 --- a/internal/api/client/media/media.go +++ b/internal/api/client/media/media.go @@ -33,6 +33,10 @@ import ( // BasePath is the base API path for making media requests const BasePath = "/api/v1/media" +// IDKey is the key for media attachment IDs +const IDKey = "id" +// BasePathWithID corresponds to a media attachment with the given ID +const BasePathWithID = BasePath + "/:" + IDKey // Module implements the ClientAPIModule interface for media type Module struct { @@ -53,6 +57,8 @@ func New(config *config.Config, processor message.Processor, log *logrus.Logger) // Route satisfies the RESTAPIModule interface func (m *Module) Route(s router.Router) error { s.AttachHandler(http.MethodPost, BasePath, m.MediaCreatePOSTHandler) + s.AttachHandler(http.MethodGet, BasePathWithID, m.MediaGETHandler) + s.AttachHandler(http.MethodPut, BasePathWithID, m.MediaPUTHandler) return nil } |