Compare commits

...

2 Commits

Author SHA1 Message Date
2558b89b63 🔊 Verbose post editing logging 2025-01-26 23:56:05 +08:00
f609ac878a 🔊 Verbose updating visibility logs 2025-01-26 21:33:25 +08:00

View File

@ -498,6 +498,8 @@ func EditPost(item models.Post) (models.Post, error) {
}
func updatePostAttachmentVisibility(item models.Post) error {
log.Debug().Any("attachments", item.Body["attachments"]).Msg("Updating post attachments visibility...")
if item.Publisher.AccountID == nil {
log.Warn().Msg("Post publisher did not have account id, skip updating attachments visibility...")
return nil
@ -518,11 +520,12 @@ func updatePostAttachmentVisibility(item models.Post) error {
UserId: lo.ToPtr(uint64(*item.Publisher.AccountID)),
IsIndexable: item.Visibility == models.PostVisibilityAll,
})
if err != nil {
log.Error().Any("attachments", val).Err(err).Msg("An error occurred when updating post attachment visibility...")
return err
}
log.Debug().Any("attachments", val).Msg("Post attachment visibility updated.")
}
return nil