Default to empty list instead of nil in media response
This commit is contained in:
parent
693b939a72
commit
a03c7bd7c9
2
media.go
2
media.go
|
@ -112,7 +112,7 @@ func handleUploadMedia(c echo.Context) error {
|
||||||
func handleGetMedia(c echo.Context) error {
|
func handleGetMedia(c echo.Context) error {
|
||||||
var (
|
var (
|
||||||
app = c.Get("app").(*App)
|
app = c.Get("app").(*App)
|
||||||
out []media.Media
|
out = []media.Media{}
|
||||||
)
|
)
|
||||||
|
|
||||||
if err := app.queries.GetMedia.Select(&out); err != nil {
|
if err := app.queries.GetMedia.Select(&out); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue