feat: update posts

This commit is contained in:
Rogee
2025-05-23 21:21:12 +08:00
parent 92136a8093
commit f370887a71
5 changed files with 68 additions and 100 deletions

View File

@@ -97,7 +97,7 @@ func (w *PublishDraftPostsWorker) Work(ctx context.Context, job *Job[PublishDraf
return media.ID, media.MimeType == "image/jpeg"
})),
}
if err := model.PostsModel.Create(ctx, post); err != nil {
if err := post.Create(ctx); err != nil {
log.Errorf("Error creating post: %v", err)
return errors.Wrap(err, "create post")
}