mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
fix creating collection
This commit is contained in:
@@ -15,11 +15,11 @@ func CreateCollection(uid uint, title string, article string, images []uint) (mo
|
||||
Article: article,
|
||||
}
|
||||
|
||||
if err := tx.Create(collection).Error; err != nil {
|
||||
if err := tx.Create(&collection).Error; err != nil {
|
||||
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user