🚨 Fix compiling failed

This commit is contained in:
2025-03-30 13:18:28 +08:00
parent 4901557217
commit 79b12624d8
4 changed files with 4 additions and 11 deletions

View File

@ -69,9 +69,6 @@ func apUserOutbox(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
} else {
for _, post := range posts {
if post == nil {
continue
}
var content string
if val, ok := post.Body["content"].(string); ok {
content = val

View File

@ -33,8 +33,8 @@ func listRecommendation(c *fiber.Ctx) error {
if err != nil {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
}
newPostMap := lo.SliceToMap(newPosts, func(item *models.Post) (uint, models.Post) {
return item.ID, *item
newPostMap := lo.SliceToMap(newPosts, func(item models.Post) (uint, models.Post) {
return item.ID, item
})
// Revert the position & truncate
@ -74,9 +74,7 @@ func listRecommendationShuffle(c *fiber.Ctx) error {
if c.QueryBool("truncate", true) {
for _, item := range items {
if item != nil {
item = lo.ToPtr(services.TruncatePostContent(*item))
}
item = services.TruncatePostContent(item)
}
}