Prettier format pending files

This commit is contained in:
Builder.io 2025-11-06 07:31:23 +00:00
parent 03bf27e45c
commit a223a4a8c9
6 changed files with 55 additions and 29 deletions

View file

@ -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

View file

@ -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}
</Badge>
</div>
<p className="text-gray-400 text-sm">
{update.description}
</p>
<p className="text-gray-400 text-sm">{update.description}</p>
</div>
<div className="text-right">
<p className="text-xs text-gray-500">{update.date}</p>

View file

@ -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;

View file

@ -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({

View file

@ -150,7 +150,9 @@ export default function DocsLayout() {
<div key={index} className="flex items-center space-x-2">
<ChevronRight className="h-4 w-4 text-gray-600" />
{crumb.isLast ? (
<span className="text-white font-medium">{crumb.name}</span>
<span className="text-white font-medium">
{crumb.name}
</span>
) : (
<Link
to={crumb.href}

View file

@ -160,7 +160,9 @@ export default function DocsApiReference() {
pagination headers for large result sets.
</p>
<pre className="rounded-lg border border-slate-700 bg-slate-950/60 p-4 text-sm text-teal-200">
{'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});'
}
</pre>
<p>
Responses include{" "}