🚨 Fix compiling failed
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user