From 55184abcb084a802ac383139095033c216ce1f8f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 29 Jan 2025 02:07:10 +0800 Subject: [PATCH] :bug: Fix prevent create duplicate wallet check issue --- pkg/internal/server/api/wallet_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/internal/server/api/wallet_api.go b/pkg/internal/server/api/wallet_api.go index 33b66c4..4374e24 100644 --- a/pkg/internal/server/api/wallet_api.go +++ b/pkg/internal/server/api/wallet_api.go @@ -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") }