Preishistory mit Genius
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user