diff --git a/api/discord/interactions.ts b/api/discord/interactions.ts index 53b7efe8..93a5ff49 100644 --- a/api/discord/interactions.ts +++ b/api/discord/interactions.ts @@ -32,9 +32,7 @@ export default function handler(req: VercelRequest, res: VercelResponse) { // Get raw body const rawBody = - typeof req.body === "string" - ? req.body - : JSON.stringify(req.body); + typeof req.body === "string" ? req.body : JSON.stringify(req.body); // Verify signature const message = `${timestamp}${rawBody}`; @@ -48,7 +46,8 @@ export default function handler(req: VercelRequest, res: VercelResponse) { return res.status(401).json({ error: "Invalid signature" }); } - const interaction = typeof req.body === "string" ? JSON.parse(req.body) : req.body; + const interaction = + typeof req.body === "string" ? JSON.parse(req.body) : req.body; console.log("[Discord] Valid interaction type:", interaction.type); // Discord sends a PING to verify the endpoint diff --git a/client/components/docs/RecentUpdatesSection.tsx b/client/components/docs/RecentUpdatesSection.tsx index 6c56caca..3a01fced 100644 --- a/client/components/docs/RecentUpdatesSection.tsx +++ b/client/components/docs/RecentUpdatesSection.tsx @@ -1,7 +1,4 @@ -import { - Card, - CardContent, -} from "@/components/ui/card"; +import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Link } from "react-router-dom"; @@ -80,9 +77,7 @@ export default function RecentUpdatesSection({ {update.type} -
- {update.description} -
+{update.description}
{update.date}
diff --git a/client/components/docs/ResourceSectionsGrid.tsx b/client/components/docs/ResourceSectionsGrid.tsx index a52a8d13..06b49c48 100644 --- a/client/components/docs/ResourceSectionsGrid.tsx +++ b/client/components/docs/ResourceSectionsGrid.tsx @@ -7,7 +7,15 @@ import { } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Link } from "react-router-dom"; -import { ArrowRight, LucideIcon, Video, Code, FileText, Puzzle, LayoutDashboard } from "lucide-react"; +import { + ArrowRight, + LucideIcon, + Video, + Code, + FileText, + Puzzle, + LayoutDashboard, +} from "lucide-react"; export interface ResourceSection { title: string; diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index 744510e0..85956467 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -383,9 +383,15 @@ export default function Dashboard() { // Teams aethexCollabService.listMyTeams(userId).catch(() => []), // Posts - communityService.getUserPosts(userId).then(p => p?.slice(0, 5) || []).catch(() => []), + communityService + .getUserPosts(userId) + .then((p) => p?.slice(0, 5) || []) + .catch(() => []), // Invites - aethexSocialService.listInvites(userId).then(i => Array.isArray(i) ? i : []).catch(() => []), + aethexSocialService + .listInvites(userId) + .then((i) => (Array.isArray(i) ? i : [])) + .catch(() => []), // Network (following, followers, connections) Promise.all([ aethexSocialService.getFollowing(userId).catch(() => []), @@ -393,12 +399,13 @@ export default function Dashboard() { aethexSocialService.getConnections(userId).catch(() => []), ]), // Applications - supabase.from("project_applications") + supabase + .from("project_applications") .select(`*, projects!inner(id, title, user_id)`) .eq("projects.user_id", userId) .order("created_at", { ascending: false }) .limit(10) - .then(({ data }) => Array.isArray(data) ? data : []) + .then(({ data }) => (Array.isArray(data) ? data : [])) .catch(() => []), // Achievements (don't block on checkAndAwardProjectAchievements - do it in background) Promise.all([ @@ -406,24 +413,29 @@ export default function Dashboard() { aethexAchievementService.getAllAchievements().catch(() => []), ]).then(([earned, all]) => ({ earned: earned || [], all: all || [] })), // Follower count - supabase.from("user_follows") + supabase + .from("user_follows") .select("id", { count: "exact", head: true }) .eq("following_id", userId) - .then(({ count }) => typeof count === "number" ? count : 0) + .then(({ count }) => (typeof count === "number" ? count : 0)) .catch(() => 0), ]); // Extract results from settled promises - const userProjects = projectsResult.status === "fulfilled" ? projectsResult.value : []; + const userProjects = + projectsResult.status === "fulfilled" ? projectsResult.value : []; setProjects(userProjects); - const myTeams = teamsResult.status === "fulfilled" ? teamsResult.value : []; + const myTeams = + teamsResult.status === "fulfilled" ? teamsResult.value : []; setTeams(myTeams); - const userPosts = postsResult.status === "fulfilled" ? postsResult.value : []; + const userPosts = + postsResult.status === "fulfilled" ? postsResult.value : []; setUserPosts(userPosts); - const myInvites = invitesResult.status === "fulfilled" ? invitesResult.value : []; + const myInvites = + invitesResult.status === "fulfilled" ? invitesResult.value : []; setInvites(myInvites); if (networkResult.status === "fulfilled") { @@ -437,7 +449,10 @@ export default function Dashboard() { setConnectionsList([]); } - const appData = applicationsResult.status === "fulfilled" ? applicationsResult.value : []; + const appData = + applicationsResult.status === "fulfilled" + ? applicationsResult.value + : []; setApplications(appData); let userAchievements: any[] = []; @@ -449,7 +464,10 @@ export default function Dashboard() { setAchievements(userAchievements); setAllAchievements(catalog); - const followerCount = followerCountResult.status === "fulfilled" ? followerCountResult.value : 0; + const followerCount = + followerCountResult.status === "fulfilled" + ? followerCountResult.value + : 0; // Calculate stats const activeCount = userProjects.filter( @@ -478,9 +496,11 @@ export default function Dashboard() { }); // Background task: Check and award achievements (don't block) - aethexAchievementService.checkAndAwardProjectAchievements(userId).catch((e) => { - console.warn("checkAndAwardProjectAchievements failed:", e); - }); + aethexAchievementService + .checkAndAwardProjectAchievements(userId) + .catch((e) => { + console.warn("checkAndAwardProjectAchievements failed:", e); + }); } catch (error) { console.error("Error loading dashboard data:", error); aethexToast.error({ diff --git a/client/pages/DocsLayout.tsx b/client/pages/DocsLayout.tsx index c21902f7..2dad1652 100644 --- a/client/pages/DocsLayout.tsx +++ b/client/pages/DocsLayout.tsx @@ -150,7 +150,9 @@ export default function DocsLayout() {
- {'fetch("https://api.aethex.dev/v1/projects?page=1&limit=25", {\n headers: {\n Authorization: "Bearer ${TOKEN}",\n "AeThex-Environment": "production",\n },\n}).then(async (res) => {\n if (!res.ok) throw new Error(await res.text());\n console.log("Projects", await res.json());\n});'}
+ {
+ 'fetch("https://api.aethex.dev/v1/projects?page=1&limit=25", {\n headers: {\n Authorization: "Bearer ${TOKEN}",\n "AeThex-Environment": "production",\n },\n}).then(async (res) => {\n if (!res.ok) throw new Error(await res.text());\n console.log("Projects", await res.json());\n});'
+ }
Responses include{" "}