mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 19:31:14 -05:00
feat: Implement user topic subscription
This commit is contained in:
@@ -128,6 +128,30 @@ serve(async (req) => {
|
||||
.delete()
|
||||
.eq('user_id', deletion.user_id);
|
||||
|
||||
// Remove from Novu before deleting auth user
|
||||
try {
|
||||
console.log(`Removing Novu subscriber: ${deletion.user_id}`);
|
||||
|
||||
const { error: novuError } = await supabaseAdmin.functions.invoke(
|
||||
'remove-novu-subscriber',
|
||||
{
|
||||
body: {
|
||||
subscriberId: deletion.user_id,
|
||||
deleteSubscriber: true // Also delete the subscriber entirely
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (novuError) {
|
||||
console.error('Failed to remove Novu subscriber:', novuError);
|
||||
} else {
|
||||
console.log('Novu subscriber removed successfully');
|
||||
}
|
||||
} catch (novuError) {
|
||||
// Non-blocking - log but continue with deletion
|
||||
console.error('Error removing Novu subscriber:', novuError);
|
||||
}
|
||||
|
||||
// Update deletion request status
|
||||
await supabaseAdmin
|
||||
.from('account_deletion_requests')
|
||||
|
||||
Reference in New Issue
Block a user