- Add viewport meta tag to prevent iOS zoom/scaling issues - Fix text color on iOS Safari (explicit text-gray-900 on buttons, inputs, TimePicker5) - Add session checks to /api/beos, /api/objekte, /api/wetter - Revert iframe embedding (X-Frame-Options: DENY, SameSite: lax) - docker-compose.prod.yml: fix DB_PORT=3306 for production - Add docker-compose.prod.yml, .env.prod.example, dump/import scripts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
745 B
TypeScript
18 lines
745 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { query } from '@/lib/db';
|
|
import { getSession } from '@/lib/session';
|
|
|
|
export async function GET() {
|
|
const session = await getSession();
|
|
if (!session) return NextResponse.json({ error: 'Nicht angemeldet' }, { status: 401 });
|
|
try {
|
|
const rows = await query(
|
|
'SELECT id AS ID, `kürzel` AS Kuerzel, CONCAT(IFNULL(vorname, \'\'), IF(vorname IS NOT NULL, \' \', \'\'), name) AS Name FROM beos WHERE `kürzel` IS NOT NULL ORDER BY name ASC'
|
|
) as { ID: number; Kuerzel: string; Name: string }[];
|
|
return NextResponse.json(rows);
|
|
} catch (error) {
|
|
console.error('GET /api/beos:', error);
|
|
return NextResponse.json({ error: 'Datenbankfehler' }, { status: 500 });
|
|
}
|
|
}
|