diff --git a/backend/internal/httpapi/handler/attachment.go b/backend/internal/httpapi/handler/attachment.go index 4ab20d81..e58c04a0 100644 --- a/backend/internal/httpapi/handler/attachment.go +++ b/backend/internal/httpapi/handler/attachment.go @@ -54,3 +54,20 @@ func (h *AttachmentHandler) Upload(c *gin.Context) { } c.JSON(http.StatusCreated, dto.AttachmentFromDomain(att)) } + +func (h *AttachmentHandler) Get(c *gin.Context) { + me := middleware.CurrentUser(c) + + attachmentID, err := parseUUIDPathParam(c, "attachment_id") + if err != nil { + respondError(c, err) + return + } + + a, err := h.svc.Get(c.Request.Context(), me.ID, attachmentID) + if err != nil { + respondError(c, err) + return + } + c.JSON(http.StatusOK, dto.AttachmentFromDomain(a)) +}