mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +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,
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user