mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-14 10:05:25 -04:00
Cancel deletions automated by cascade delete
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user