Initial commit - SaveTheMoment Atlas Basis-Setup

This commit is contained in:
Dennis Forte
2025-11-12 20:21:32 +01:00
commit 0b6e429329
167 changed files with 30843 additions and 0 deletions

41
app/api/prices/route.ts Normal file
View File

@@ -0,0 +1,41 @@
import { NextRequest, NextResponse } from 'next/server';
import { prisma } from '@/lib/prisma';
export async function GET(request: NextRequest) {
try {
const searchParams = request.nextUrl.searchParams;
const locationSlug = searchParams.get('location');
if (!locationSlug) {
return NextResponse.json(
{ error: 'Location parameter required' },
{ status: 400 }
);
}
const location = await prisma.location.findUnique({
where: { slug: locationSlug },
});
if (!location) {
return NextResponse.json(
{ error: 'Location not found' },
{ status: 404 }
);
}
const prices = await prisma.priceConfig.findMany({
where: {
locationId: location.id,
},
});
return NextResponse.json({ prices });
} catch (error) {
console.error('Prices fetch error:', error);
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
);
}
}