🐛 Try to fix post has no published at

This commit is contained in:
2024-07-29 11:47:02 +08:00
parent 7ae1f8021b
commit 0519d99bbd
3 changed files with 8 additions and 4 deletions

View File

@ -240,10 +240,6 @@ func NewPost(user models.Account, item models.Post) (models.Post, error) {
}
}
if !item.IsDraft && item.PublishedAt == nil {
item.PublishedAt = lo.ToPtr(time.Now())
}
log.Debug().Msg("Saving post record into database...")
if err := database.C.Save(&item).Error; err != nil {
return item, err