Compare commits
2 Commits
86db065117
...
2558b89b63
Author | SHA1 | Date | |
---|---|---|---|
2558b89b63 | |||
f609ac878a |
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user