fix feed empty list rendering

This commit is contained in:
leonincs
2026-04-23 19:00:02 +08:00
parent 89c281c8f0
commit d7a0e2a6b7
10 changed files with 112 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package social
import (
"feedsystem_video_go/internal/account"
"feedsystem_video_go/internal/middleware/jwt"
"net/http"
@@ -89,6 +90,9 @@ func (h *SocialHandler) GetAllFollowers(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if followers == nil {
followers = []*account.Account{}
}
c.JSON(http.StatusOK, GetAllFollowersResponse{Followers: followers})
}
@@ -114,5 +118,8 @@ func (h *SocialHandler) GetAllVloggers(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if vloggers == nil {
vloggers = []*account.Account{}
}
c.JSON(http.StatusOK, GetAllVloggersResponse{Vloggers: vloggers})
}