feat: add weather widget to user portal below navbar

This commit is contained in:
2026-06-28 23:36:29 -05:00
parent 291df16f1f
commit 59698686d5
2 changed files with 47 additions and 1 deletions
+11
View File
@@ -42,6 +42,16 @@ export async function GET() {
[userId]
);
// Get weather
let weather = undefined;
try {
const weatherRes = await fetch('http://localhost:3000/api/weather');
if (weatherRes.ok) {
const weatherData = await weatherRes.json();
weather = weatherData.data;
}
} catch { /* ignore */ }
return NextResponse.json({
reservations,
coupons,
@@ -49,6 +59,7 @@ export async function GET() {
benefits: benefits.map((b: { text: string }) => b.text),
wifiPassword,
trips,
weather,
});
} catch (error) {
if ((error as Error).message === 'Unauthorized') {