Refactor account deletion flow

This commit is contained in:
gpt-engineer-app[bot]
2025-10-12 14:31:26 +00:00
parent 8d814d43a1
commit 391e6a07fd
6 changed files with 59 additions and 139 deletions

View File

@@ -20,11 +20,11 @@ serve(async (req) => {
console.log('Processing scheduled account deletions...');
// Find pending deletion requests that are past their scheduled date
// Find confirmed deletion requests that are past their scheduled date
const { data: pendingDeletions, error: fetchError } = await supabaseAdmin
.from('account_deletion_requests')
.select('*')
.eq('status', 'pending')
.eq('status', 'confirmed')
.lt('scheduled_deletion_at', new Date().toISOString());
if (fetchError) {