feat: add partners page#13
Conversation
calebephrem
commented
Jun 22, 2026
- add partners page
- add more redirect links
|
@calebephrem is attempting to deploy a commit to the aditya ojha's projects Team on Vercel. A member of the Team first needs to authorize it. |
Summary by BeetleThis PR enhances the website's navigation and community engagement capabilities by adding a comprehensive partners page and expanding redirect link options. The changes introduce a new 📁 File Changes Summary (Consolidated across all commits):
Total Changes: 3 files changed, +668 additions, -2 deletions 🗺️ Walkthrough:sequenceDiagram
participant User
participant Website
participant Discord API
participant Partner Server
User->>Website: Visit /partners
Website->>Website: Render page skeleton
par Fetch all partner data
Website->>Discord API: GET /invites/{code1}?with_counts=true
Website->>Discord API: GET /invites/{code2}?with_counts=true
Website->>Discord API: GET /invites/{code3}?with_counts=true
end
Discord API-->>Website: Return guild metadata
Note over Discord API,Website: name, description, icon, banner, member count, online count
Website->>Website: Process & render cards
Note over Website: Apply fallback styling if banner/icon missing
Website-->>User: Display partner cards
User->>Website: Click "Join Server"
Website->>Partner Server: Redirect to discord.gg/{code}
Partner Server-->>User: Discord invite page
User->>Website: Click "Website"
Website->>Partner Server: Open partner website
🎯 Key Changes:
📊 Impact Assessment:
⚙️ SettingsSeverity Threshold: 📖 User Guide
|
| const results = await Promise.allSettled( | ||
| partners.map((p) => | ||
| fetch( | ||
| `https://discord.com/api/v10/invites/${p.inviteCode}?with_counts=true`, | ||
| ).then((r) => r.json()), | ||
| ), | ||
| ); |
There was a problem hiding this comment.
The Discord API fetch operations lack error handling and could fail silently. While Promise.allSettled prevents complete failure, individual fetch errors aren't logged or handled, making debugging difficult. Additionally, there's no timeout mechanism, which could cause the page to hang indefinitely if Discord's API is slow or unresponsive.
Confidence: 5/5
Suggested Fix
| const results = await Promise.allSettled( | |
| partners.map((p) => | |
| fetch( | |
| `https://discord.com/api/v10/invites/${p.inviteCode}?with_counts=true`, | |
| ).then((r) => r.json()), | |
| ), | |
| ); | |
| const results = await Promise.allSettled( | |
| partners.map((p) => | |
| fetch( | |
| `https://discord.com/api/v10/invites/${p.inviteCode}?with_counts=true`, | |
| { signal: AbortSignal.timeout(5000) } | |
| ) | |
| .then((r) => { | |
| if (!r.ok) throw new Error(`HTTP ${r.status}`); | |
| return r.json(); | |
| }) | |
| .catch((err) => { | |
| console.error(`Failed to fetch Discord data for ${p.inviteCode}:`, err); | |
| return null; | |
| }), | |
| ), | |
| ); | |
Add a 5-second timeout to prevent hanging requests, check HTTP response status, and log errors for debugging. The catch block ensures failed requests return null gracefully while providing visibility into failures.
Prompt for AI
Copy this prompt to your AI IDE to fix this issue locally:
In app/partners/page.tsx around line 118, the Discord API fetch operations lack error handling and timeout mechanisms; add a 5-second timeout using AbortSignal.timeout(5000), check the HTTP response status with if (!r.ok) throw new Error, and add a catch block to log errors with console.error while returning null for failed requests to ensure graceful degradation.
📍 This suggestion applies to lines 118-124
Co-authored-by: beetle-ai[bot] <221859081+beetle-ai[bot]@users.noreply.github.com>
|
Important Review skipped Bot user detected. To trigger a single review, invoke the ⚙️ SettingsSeverity Threshold: 📖 User Guide
|