🐛 Fix prevent create duplicate wallet check issue
This commit is contained in:
parent
b91fa1d01d
commit
55184abcb0
@ -29,7 +29,7 @@ func createWallet(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
var wallet models.Wallet
|
var wallet models.Wallet
|
||||||
if err := database.C.Where("account_id = ?", user.ID).
|
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")
|
return fiber.NewError(fiber.StatusConflict, "wallet already exists")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user