This commit is contained in:
Rio
2026-06-18 12:16:27 +07:00
parent 7de3a3b4b1
commit 5c0ab92401
84 changed files with 12562 additions and 285 deletions
+17
View File
@@ -0,0 +1,17 @@
import { NextResponse } from 'next/server';
import { prisma } from '@/lib/db';
export async function GET() {
try {
const routes = await prisma.route.findMany({
orderBy: [
{ departureCity: 'asc' },
{ arrivalCity: 'asc' },
],
});
return NextResponse.json({ routes });
} catch (error) {
console.error('Fetch routes error:', error);
return NextResponse.json({ error: 'Failed to fetch routes' }, { status: 500 });
}
}