feat: add weather widget to user portal below navbar
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user