🐛 Fix prevent create duplicate wallet check issue

This commit is contained in:
LittleSheep 2025-01-29 02:07:10 +08:00
parent b91fa1d01d
commit 55184abcb0

View File

@ -29,7 +29,7 @@ func createWallet(c *fiber.Ctx) error {
var wallet models.Wallet
if err := database.C.Where("account_id = ?", user.ID).
First(&wallet).Error; err == nil || errors.Is(err, gorm.ErrRecordNotFound) {
First(&wallet).Error; err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
return fiber.NewError(fiber.StatusConflict, "wallet already exists")
}