From a7d614e9eddec96785730c4b798f06790bde5a2c Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 09:32:17 +0000 Subject: [PATCH] Prettier format pending files --- client/api/applications.ts | 12 ++++----- client/api/creators.ts | 16 +++++------- client/contexts/AuthContext.tsx | 5 +++- client/lib/aethex-database-adapter.ts | 15 ++++++----- client/pages/Login.tsx | 3 +-- .../pages/dashboards/FoundationDashboard.tsx | 12 ++++----- client/pages/dashboards/NexusDashboard.tsx | 26 +++++++++---------- 7 files changed, 43 insertions(+), 46 deletions(-) diff --git a/client/api/applications.ts b/client/api/applications.ts index 9a5fd589..3389c59e 100644 --- a/client/api/applications.ts +++ b/client/api/applications.ts @@ -44,7 +44,8 @@ export interface ApplicationWithCreator { }; } -const getApiBase = () => typeof window !== "undefined" ? window.location.origin : ""; +const getApiBase = () => + typeof window !== "undefined" ? window.location.origin : ""; export async function getMyApplications(filters?: { status?: string; @@ -107,11 +108,8 @@ export async function withdrawApplication( ): Promise { const apiBase = getApiBase(); if (!apiBase) throw new Error("No API base available"); - const response = await fetch( - `${apiBase}/api/applications/${applicationId}`, - { - method: "DELETE", - }, - ); + const response = await fetch(`${apiBase}/api/applications/${applicationId}`, { + method: "DELETE", + }); if (!response.ok) throw new Error("Failed to withdraw application"); } diff --git a/client/api/creators.ts b/client/api/creators.ts index 7b3262c4..a738fbfd 100644 --- a/client/api/creators.ts +++ b/client/api/creators.ts @@ -51,7 +51,8 @@ export interface CreatorsResponse { }; } -const getApiBase = () => typeof window !== "undefined" ? window.location.origin : ""; +const getApiBase = () => + typeof window !== "undefined" ? window.location.origin : ""; export async function getCreators(filters?: { arm?: string; @@ -170,13 +171,10 @@ export async function endorseSkill( ): Promise { const apiBase = getApiBase(); if (!apiBase) throw new Error("No API base available"); - const response = await fetch( - `${apiBase}/api/creators/${creatorId}/endorse`, - { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ skill }), - }, - ); + const response = await fetch(`${apiBase}/api/creators/${creatorId}/endorse`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ skill }), + }); if (!response.ok) throw new Error("Failed to endorse skill"); } diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index c185c9fa..ed5edbbc 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -397,7 +397,10 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ rewardsActivatedRef.current = true; // Only attempt to activate if this is the admin user - if (profile?.email === "mrpiglr@gmail.com" || profile?.username === "mrpiglr") { + if ( + profile?.email === "mrpiglr@gmail.com" || + profile?.username === "mrpiglr" + ) { aethexAchievementService .activateCommunityRewards({ email: profile?.email, diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 87e03179..8241092f 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -301,7 +301,10 @@ export const aethexUserService = { await this.updateProfile(user.id, { username: "mrpiglr", }).catch((err) => { - console.warn("[Profile] Failed to auto-populate mrpiglr username:", err); + console.warn( + "[Profile] Failed to auto-populate mrpiglr username:", + err, + ); }); normalized.username = "mrpiglr"; } @@ -1001,7 +1004,8 @@ export const aethexAchievementService = { ensureSupabase(); try { - const baseUrl = typeof window !== "undefined" ? window.location.origin : ""; + const baseUrl = + typeof window !== "undefined" ? window.location.origin : ""; if (!baseUrl) { console.warn("[Achievement] Cannot award - no origin available"); return; @@ -1082,12 +1086,11 @@ export const aethexAchievementService = { // Always use the current origin for API calls since the API is served from the same origin // This works for both development (localhost:8080) and production (aethex.dev) - const baseUrl = typeof window !== "undefined" ? window.location.origin : ""; + const baseUrl = + typeof window !== "undefined" ? window.location.origin : ""; if (!baseUrl) { - console.warn( - "[Rewards] Cannot activate - no origin available", - ); + console.warn("[Rewards] Cannot activate - no origin available"); return null; } diff --git a/client/pages/Login.tsx b/client/pages/Login.tsx index 2bedc304..7913f756 100644 --- a/client/pages/Login.tsx +++ b/client/pages/Login.tsx @@ -262,8 +262,7 @@ export default function Login() { nonce: nonce.nonce, signature, redirectTo: - window.location.origin + - (profile ? "/dashboard" : "/onboarding"), + window.location.origin + (profile ? "/dashboard" : "/onboarding"), }), }) .then((r) => (r.ok ? r.json() : null)) diff --git a/client/pages/dashboards/FoundationDashboard.tsx b/client/pages/dashboards/FoundationDashboard.tsx index e04d9f4c..909511c6 100644 --- a/client/pages/dashboards/FoundationDashboard.tsx +++ b/client/pages/dashboards/FoundationDashboard.tsx @@ -33,7 +33,8 @@ import { CoursesWidget } from "@/components/CoursesWidget"; import { MentorshipWidget } from "@/components/MentorshipWidget"; import { AchievementsWidget } from "@/components/AchievementsWidget"; -const getApiBase = () => typeof window !== "undefined" ? window.location.origin : ""; +const getApiBase = () => + typeof window !== "undefined" ? window.location.origin : ""; export default function FoundationDashboard() { const navigate = useNavigate(); @@ -81,12 +82,9 @@ export default function FoundationDashboard() { console.warn("[Foundation] No API base available"); return; } - const mentorRes = await fetch( - `${apiBase}/api/foundation/mentorships`, - { - headers: { Authorization: `Bearer ${token}` }, - }, - ); + const mentorRes = await fetch(`${apiBase}/api/foundation/mentorships`, { + headers: { Authorization: `Bearer ${token}` }, + }); if ( mentorRes.ok && mentorRes.headers.get("content-type")?.includes("application/json") diff --git a/client/pages/dashboards/NexusDashboard.tsx b/client/pages/dashboards/NexusDashboard.tsx index 3f4552f8..4bb583b3 100644 --- a/client/pages/dashboards/NexusDashboard.tsx +++ b/client/pages/dashboards/NexusDashboard.tsx @@ -36,7 +36,8 @@ import { ToggleRight, } from "lucide-react"; -const getApiBase = () => typeof window !== "undefined" ? window.location.origin : ""; +const getApiBase = () => + typeof window !== "undefined" ? window.location.origin : ""; type ViewMode = "creator" | "client"; @@ -234,20 +235,17 @@ export default function NexusDashboard() { setCreatorProfile(updatedProfile); // Update user profile to mark Nexus as complete - const userProfileRes = await fetch( - `${apiBase}/api/user/profile-update`, - { - method: "POST", - headers: { - Authorization: `Bearer ${token}`, - "Content-Type": "application/json", - }, - body: JSON.stringify({ - nexus_profile_complete: true, - nexus_headline: profileFormData.headline, - }), + const userProfileRes = await fetch(`${apiBase}/api/user/profile-update`, { + method: "POST", + headers: { + Authorization: `Bearer ${token}`, + "Content-Type": "application/json", }, - ); + body: JSON.stringify({ + nexus_profile_complete: true, + nexus_headline: profileFormData.headline, + }), + }); if (userProfileRes.ok) { aethexToast({