Add userID to dup find for Card
This commit is contained in:
parent
daec467e8c
commit
8960e2e7ba
|
@ -28,7 +28,7 @@ func (c *Card) BeforeSave(tx *gorm.DB) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
var dup Card
|
var dup Card
|
||||||
if err := tx.Find(&dup, Card{Name: c.Name}).Error; err != nil {
|
if err := tx.Find(&dup, Card{Name: c.Name, UserID: c.UserID}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user