enbas/internal/client/media.go
Dan Anglin e8114f8d22
feat: view media attachment information
View media attachment information in the timeline and status views.
Users can also show detailed information of the attachments via the
attachment ID.
2024-06-18 19:58:59 +01:00

20 lines
534 B
Go

package client
import (
"fmt"
"net/http"
"codeflow.dananglin.me.uk/apollo/enbas/internal/model"
)
func (g *Client) GetMediaAttachment(mediaAttachmentID string) (model.Attachment, error) {
url := g.Authentication.Instance + "/api/v1/media/" + mediaAttachmentID
var attachment model.Attachment
if err := g.sendRequest(http.MethodGet, url, nil, &attachment); err != nil {
return model.Attachment{}, fmt.Errorf("received an error after sending the request to get the media attachment: %w", err)
}
return attachment, nil
}