Fix issue with updating the same entity

This commit is contained in:
qowevisa 2024-10-31 10:09:50 +02:00
parent db53f2a486
commit 79b83026f5

View File

@ -47,7 +47,7 @@ func (c *Card) BeforeSave(tx *gorm.DB) error {
return err return err
} }
if dup.ID != 0 { if c.ID != dup.ID && dup.ID != 0 {
return ERROR_CARD_NAME_NOT_UNIQUE return ERROR_CARD_NAME_NOT_UNIQUE
} }