Skip to content

Commit

Permalink
Fixing the Add Episodic response handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CerealBoy committed Jul 6, 2024
1 parent aede987 commit 6ab17c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func postEpisodic(c *gin.Context) {
if err != nil {
return gin.H{}, []string{err.Error()}, http.StatusInternalServerError
}
return good(res)
return good(gin.H{"episodic": res, "meta": []string{}})
})
}

Expand All @@ -315,9 +315,11 @@ func putEpisodic(c *gin.Context) {
body := &types.AddEpisodic{}
ctx.BindJSON(body)
res, err := db.UpdateEpisodic(ctx, id, body)
meta := generateMetaFromEpisodes(res.Episodes)

if err != nil {
return gin.H{}, []string{err.Error()}, http.StatusInternalServerError
}
return good(res)
return good(gin.H{"episodic": res, "meta": meta})
})
}

0 comments on commit 6ab17c7

Please sign in to comment.