feat: implement core platform features including business directory, admin dashboard, authentication, and API infrastructure
Some checks failed
Build and Push App / build (push) Failing after 16m2s
Some checks failed
Build and Push App / build (push) Failing after 16m2s
This commit is contained in:
15
app/api/countries/route.ts
Normal file
15
app/api/countries/route.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import prisma from '@/lib/prisma';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const countries = await prisma.country.findMany({
|
||||
where: { isActive: true },
|
||||
orderBy: { name: 'asc' }
|
||||
});
|
||||
return NextResponse.json(countries);
|
||||
} catch (error) {
|
||||
console.error('GET /api/countries error:', error);
|
||||
return NextResponse.json({ error: 'Erreur serveur' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user