A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: Optimize user delete
Luffy15cbfa870f93
diff --git a/internal/repo/user/user_backyard_repo.go b/internal/repo/user/user_backyard_repo.goindex 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 usersfunc (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()}