🐛 Fix back compability of draft state

This commit is contained in:
2024-07-05 20:56:25 +08:00
parent 5b8eff7a42
commit d7113b5237
3 changed files with 2 additions and 14 deletions

View File

@@ -51,7 +51,7 @@ func FilterPostWithAuthorDraft(tx *gorm.DB, uid uint) *gorm.DB {
}
func FilterPostDraft(tx *gorm.DB) *gorm.DB {
return tx.Where("is_draft = ?", false)
return tx.Where("is_draft = ? OR is_draft IS NULL", false)
}
func GetPostWithAlias(tx *gorm.DB, alias string, ignoreLimitation ...bool) (models.Post, error) {