This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 15cbfa870f9301cf72f6a441982c86009cb7bc71
Author: Luffy <[email protected]>
AuthorDate: Thu Dec 19 19:08:05 2024 +0800

    fix: Optimize user delete
---
 internal/repo/user/user_backyard_repo.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/internal/repo/user/user_backyard_repo.go 
b/internal/repo/user/user_backyard_repo.go
index 62f7f789..abcbb09f 100644
--- a/internal/repo/user/user_backyard_repo.go
+++ b/internal/repo/user/user_backyard_repo.go
@@ -178,7 +178,7 @@ func (ur *userAdminRepo) GetUserPage(ctx context.Context, 
page, pageSize int, us
 
 // DeletePermanentlyUsers delete permanently users
 func (ur *userAdminRepo) DeletePermanentlyUsers(ctx context.Context) (err 
error) {
-       _, err = ur.data.DB.Context(ctx).Where("deleted_at IS NOT 
NULL").Delete(&entity.User{})
+       _, err = ur.data.DB.Context(ctx).Where("status = ?", 
entity.UserStatusDeleted).Delete(&entity.User{})
        if err != nil {
                err = 
errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
        }

Reply via email to