fix feed empty list rendering
This commit is contained in:
@@ -90,5 +90,8 @@ func (h *CommentHandler) GetAllComments(c *gin.Context) {
|
||||
c.JSON(400, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if comments == nil {
|
||||
comments = []Comment{}
|
||||
}
|
||||
c.JSON(200, comments)
|
||||
}
|
||||
|
||||
@@ -106,5 +106,8 @@ func (lh *LikeHandler) ListMyLikedVideos(c *gin.Context) {
|
||||
c.JSON(500, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if videos == nil {
|
||||
videos = []Video{}
|
||||
}
|
||||
c.JSON(200, videos)
|
||||
}
|
||||
|
||||
@@ -207,6 +207,9 @@ func (vh *VideoHandler) ListByAuthorID(c *gin.Context) {
|
||||
c.JSON(400, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if videos == nil {
|
||||
videos = []Video{}
|
||||
}
|
||||
c.JSON(200, videos)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user