fix creating collection

This commit is contained in:
2025-07-31 09:36:17 +08:00
parent 15db44e956
commit 12237ee0a4

View File

@@ -15,11 +15,11 @@ func CreateCollection(uid uint, title string, article string, images []uint) (mo
Article: article, Article: article,
} }
if err := tx.Create(collection).Error; err != nil { if err := tx.Create(&collection).Error; err != nil {
return err return err
} }
if err := tx.Model(collection).Association("Images").Replace(images); err != nil { if err := tx.Model(&collection).Association("Images").Replace(images); err != nil {
return err return err
} }