Skip to content

Commit

Permalink
Send full media object in upload API response. Closes knadh#770.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Jul 13, 2022
1 parent c84837f commit 77bc8a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ func handleUploadMedia(c echo.Context) error {
}

// Write to the DB.
// TODO: cleanup
if _, err := app.core.InsertMedia(fName, thumbfName, app.constants.MediaProvider, app.media); err != nil {
m, err := app.core.InsertMedia(fName, thumbfName, app.constants.MediaProvider, app.media)
if err != nil {
cleanUp = true
return err
}
return c.JSON(http.StatusOK, okResp{true})
return c.JSON(http.StatusOK, okResp{m})
}

// handleGetMedia handles retrieval of uploaded media.
Expand Down

0 comments on commit 77bc8a7

Please sign in to comment.