Add userID to dup find for Card

This commit is contained in:
qowevisa 2024-08-03 10:45:09 +03:00
parent daec467e8c
commit 8960e2e7ba

View File

@ -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
} }