From ccc280001e8a2cf0c6051e09f8897db1fd595a02 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Thu, 13 Nov 2025 03:58:48 +0000 Subject: [PATCH] Prettier format pending files --- api/user/delete-account.ts | 56 ++++++++++------------------------ client/lib/ethos-storage.ts | 11 +++---- client/pages/Dashboard.tsx | 4 +-- index.html | 6 +++- server/index.ts | 60 ++++++++++++++++--------------------- 5 files changed, 50 insertions(+), 87 deletions(-) diff --git a/api/user/delete-account.ts b/api/user/delete-account.ts index 2a5b4d56..d7e7be28 100644 --- a/api/user/delete-account.ts +++ b/api/user/delete-account.ts @@ -15,13 +15,10 @@ export default async (req: Request) => { headers.get("Authorization")?.replace("Bearer ", "") || ""; if (adminToken !== "mrpiglr-admin-token") { - return new Response( - JSON.stringify({ error: "Unauthorized" }), - { - status: 401, - headers: { "Content-Type": "application/json" }, - }, - ); + return new Response(JSON.stringify({ error: "Unauthorized" }), { + status: 401, + headers: { "Content-Type": "application/json" }, + }); } const { email } = await req.json(); @@ -62,52 +59,28 @@ export default async (req: Request) => { // Delete from various tables // 1. Delete achievements - await supabase - .from("achievements_earned") - .delete() - .eq("user_id", userId); + await supabase.from("achievements_earned").delete().eq("user_id", userId); // 2. Delete applications - await supabase - .from("applications") - .delete() - .eq("user_id", userId); + await supabase.from("applications").delete().eq("user_id", userId); // 3. Delete creator profiles - await supabase - .from("creator_profiles") - .delete() - .eq("user_id", userId); + await supabase.from("creator_profiles").delete().eq("user_id", userId); // 4. Delete projects - await supabase - .from("projects") - .delete() - .eq("user_id", userId); + await supabase.from("projects").delete().eq("user_id", userId); // 5. Delete social posts - await supabase - .from("social_posts") - .delete() - .eq("user_id", userId); + await supabase.from("social_posts").delete().eq("user_id", userId); // 6. Delete linked emails - await supabase - .from("user_email_links") - .delete() - .eq("user_id", userId); + await supabase.from("user_email_links").delete().eq("user_id", userId); // 7. Delete Discord links - await supabase - .from("discord_links") - .delete() - .eq("user_id", userId); + await supabase.from("discord_links").delete().eq("user_id", userId); // 8. Delete web3 wallets - await supabase - .from("web3_wallets") - .delete() - .eq("user_id", userId); + await supabase.from("web3_wallets").delete().eq("user_id", userId); // 9. Delete user profile const { error: profileDeleteError } = await supabase @@ -130,8 +103,9 @@ export default async (req: Request) => { // 10. Delete from Supabase auth (this is a special call) // Note: This requires admin access and will remove the auth user - const { error: authError } = await (supabase.auth.admin as any) - .deleteUser(userId); + const { error: authError } = await (supabase.auth.admin as any).deleteUser( + userId, + ); if (authError) { console.error("Auth deletion error:", authError); diff --git a/client/lib/ethos-storage.ts b/client/lib/ethos-storage.ts index d0f18012..09b6d313 100644 --- a/client/lib/ethos-storage.ts +++ b/client/lib/ethos-storage.ts @@ -68,9 +68,7 @@ export const ethosStorage = { * @returns The public URL for the file */ getPublicUrl(filePath: string): string { - const { data } = supabase.storage - .from(BUCKET_NAME) - .getPublicUrl(filePath); + const { data } = supabase.storage.from(BUCKET_NAME).getPublicUrl(filePath); return data.publicUrl; }, @@ -116,9 +114,7 @@ export const ethosStorage = { */ async getFileMetadata(filePath: string) { try { - const { data, error } = await supabase.storage - .from(BUCKET_NAME) - .info(); + const { data, error } = await supabase.storage.from(BUCKET_NAME).info(); if (error) { throw error; @@ -139,7 +135,8 @@ export const ethosStorage = { */ export async function getAudioDuration(file: File): Promise { return new Promise((resolve, reject) => { - const audioContext = new (window.AudioContext || (window as any).webkitAudioContext)(); + const audioContext = new (window.AudioContext || + (window as any).webkitAudioContext)(); const fileReader = new FileReader(); fileReader.onload = async (e) => { diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index adf37f2d..ca994a65 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -318,9 +318,7 @@ export default function Dashboard() { console.log("User and profile exist, loading dashboard data"); loadDashboardData(); } else if (user && !profile) { - console.log( - "User exists but no profile, keeping loading screen visible", - ); + console.log("User exists but no profile, keeping loading screen visible"); // Keep loading visible while waiting for profile, then onboarding will take over // Don't set isLoading to false yet } diff --git a/index.html b/index.html index 092f1a32..8dde28a4 100644 --- a/index.html +++ b/index.html @@ -49,7 +49,11 @@ href="https://docs.aethex.tech/~gitbook/image?url=https%3A%2F%2F1143808467-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Forganizations%252FDhUg3jal6kdpG645FzIl%252Fsites%252Fsite_HeOmR%252Flogo%252FqxDYz8Oj2SnwUTa8t3UB%252FAeThex%2520Origin%2520logo.png%3Falt%3Dmedia%26token%3D200e8ea2-0129-4cbe-b516-4a53f60c512b&width=180&dpr=1&quality=100&sign=6c7576ce&sv=2" /> - + diff --git a/server/index.ts b/server/index.ts index 6cfc1a43..6aa04fab 100644 --- a/server/index.ts +++ b/server/index.ts @@ -1094,7 +1094,7 @@ export function createServer() { }); return res.status(500).json({ error: insertError.message, - details: insertError.details + details: insertError.details, }); } @@ -2523,19 +2523,17 @@ export function createServer() { }; const uuidId = generateDeterministicUUID(achievement.id); - const { error } = await adminSupabase - .from("achievements") - .upsert( - { - id: uuidId, - name: achievement.name, - description: achievement.description, - icon: achievement.icon, - badge_color: achievement.badge_color, - xp_reward: achievement.xp_reward, - }, - { onConflict: "id" } - ); + const { error } = await adminSupabase.from("achievements").upsert( + { + id: uuidId, + name: achievement.name, + description: achievement.description, + icon: achievement.icon, + badge_color: achievement.badge_color, + xp_reward: achievement.xp_reward, + }, + { onConflict: "id" }, + ); if (error) { console.error( @@ -4120,7 +4118,10 @@ export function createServer() { devconnect_link: devConnectLink, }); } catch (e: any) { - console.error("[Creator API] Error fetching creator by user_id:", e?.message); + console.error( + "[Creator API] Error fetching creator by user_id:", + e?.message, + ); return res.status(500).json({ error: "Failed to fetch creator" }); } }); @@ -5079,9 +5080,7 @@ export function createServer() { res.status(201).json(data[0]); } catch (e: any) { console.error("[Ethos Tracks API] Error creating track:", e?.message); - res - .status(500) - .json({ error: e?.message || "Failed to create track" }); + res.status(500).json({ error: e?.message || "Failed to create track" }); } }); @@ -5170,7 +5169,10 @@ export function createServer() { offset: Number(offset), }); } catch (e: any) { - console.error("[Ethos Artists API] Error fetching artists:", e?.message); + console.error( + "[Ethos Artists API] Error fetching artists:", + e?.message, + ); res .status(500) .json({ error: e?.message || "Failed to fetch artists" }); @@ -5810,25 +5812,16 @@ export function createServer() { .delete() .eq("user_id", userId); - await adminSupabase - .from("applications") - .delete() - .eq("user_id", userId); + await adminSupabase.from("applications").delete().eq("user_id", userId); await adminSupabase .from("creator_profiles") .delete() .eq("user_id", userId); - await adminSupabase - .from("projects") - .delete() - .eq("user_id", userId); + await adminSupabase.from("projects").delete().eq("user_id", userId); - await adminSupabase - .from("social_posts") - .delete() - .eq("user_id", userId); + await adminSupabase.from("social_posts").delete().eq("user_id", userId); await adminSupabase .from("user_email_links") @@ -5840,10 +5833,7 @@ export function createServer() { .delete() .eq("user_id", userId); - await adminSupabase - .from("web3_wallets") - .delete() - .eq("user_id", userId); + await adminSupabase.from("web3_wallets").delete().eq("user_id", userId); // Delete user profile const { error: profileDeleteError } = await adminSupabase