From 8960e2e7ba01c4482dc5a7688c7392ab3fc20a1b Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 3 Aug 2024 10:45:09 +0300 Subject: [PATCH] Add userID to dup find for Card --- db/card.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/card.go b/db/card.go index 9d698ec..e4490fb 100644 --- a/db/card.go +++ b/db/card.go @@ -28,7 +28,7 @@ func (c *Card) BeforeSave(tx *gorm.DB) error { } 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 }