Preishistory mit Genius

This commit is contained in:
2026-08-16 10:00:13 +00:00
parent 472d225fda
commit 2b13daf3a0
4 changed files with 1374 additions and 607 deletions

View File

@@ -6,11 +6,11 @@ export const dynamic = 'force-dynamic';
export async function GET(req: NextRequest, { params }: { params: { id: string } }) {
try {
const { id } = params;
const res = await query(
`SELECT
id,
price_numeric::float AS price,
genius_price_numeric::float AS genius_price,
price_per_night::float AS price_per_night,
price_per_person::float AS price_per_person,
nights,
@@ -21,10 +21,9 @@ export async function GET(req: NextRequest, { params }: { params: { id: string }
ORDER BY tracked_at ASC`,
[id]
);
return NextResponse.json({ success: true, prices: res.rows });
} catch (error: any) {
console.error('Fehler beim Laden der Preishistorie:', error.message);
return NextResponse.json({ success: false, error: error.message, prices: [] }, { status: 500 });
}
}
}