From cb3cc3f540241e383ccef9745c610b800f532865 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 25 Sep 2024 20:18:11 +0800 Subject: [PATCH] :bug: Fix check delete account issue --- pkg/internal/services/accounts.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/internal/services/accounts.go b/pkg/internal/services/accounts.go index 59edcc4..34d2240 100644 --- a/pkg/internal/services/accounts.go +++ b/pkg/internal/services/accounts.go @@ -3,11 +3,12 @@ package services import ( "context" "fmt" - "git.solsynth.dev/hydrogen/dealer/pkg/proto" - "git.solsynth.dev/hydrogen/passport/pkg/internal/gap" "time" "unicode" + "git.solsynth.dev/hydrogen/dealer/pkg/proto" + "git.solsynth.dev/hydrogen/passport/pkg/internal/gap" + "gorm.io/gorm/clause" "github.com/rs/zerolog/log" @@ -191,7 +192,7 @@ func CheckAbleToDeleteAccount(user models.Account) error { if err := database.C. Where("account_id = ?", user.ID). Where("expired_at < ?", time.Now()). - Where("type = ?", models.ResetPasswordMagicToken). + Where("type = ?", models.DeleteAccountMagicToken). Model(&models.MagicToken{}). Count(&count).Error; err != nil { return fmt.Errorf("unable to check delete account ability: %v", err)