From 8f641d117ae916fdb8f0d18353324f9657e501a8 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 24 Oct 2025 01:08:39 +0200 Subject: [PATCH] Cancel deletions automated by cascade delete --- backend/api/src/delete-me.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/api/src/delete-me.ts b/backend/api/src/delete-me.ts index 7775d8cd..4b98dadc 100644 --- a/backend/api/src/delete-me.ts +++ b/backend/api/src/delete-me.ts @@ -24,10 +24,11 @@ export const deleteMe: APIHandler<'me/delete'> = async (body, auth) => { // Remove user data from Supabase const pg = createSupabaseDirectClient() await pg.none('DELETE FROM users WHERE id = $1', [userId]) - await pg.none('DELETE FROM private_users WHERE id = $1', [userId]) - await pg.none('DELETE FROM profiles WHERE user_id = $1', [userId]) - await pg.none('DELETE FROM bookmarked_searches WHERE creator_id = $1', [userId]) - await pg.none('DELETE FROM compatibility_answers WHERE creator_id = $1', [userId]) + // Should cascade delete in other tables + // await pg.none('DELETE FROM private_users WHERE id = $1', [userId]) + // await pg.none('DELETE FROM profiles WHERE user_id = $1', [userId]) + // await pg.none('DELETE FROM bookmarked_searches WHERE creator_id = $1', [userId]) + // await pg.none('DELETE FROM compatibility_answers WHERE creator_id = $1', [userId]) // May need to also delete from other tables in the future (such as messages, compatibility responses, etc.) // Delete user files from Firebase Storage