Add rooms, menu, places, reviews APIs and site config bulk endpoint

This commit is contained in:
2026-06-27 18:06:31 -05:00
parent 3294471a94
commit 4bb3596412
13 changed files with 454 additions and 2 deletions
+6 -1
View File
@@ -5,7 +5,12 @@ import { db } from '@/lib/db';
export async function GET(request: NextRequest) {
const key = request.nextUrl.searchParams.get('key');
if (!key) {
return NextResponse.json({ error: 'Missing key' }, { status: 400 });
const { rows } = await db.query(
`SELECT key, value FROM config WHERE key IN ('logo','facebook_url','instagram_url','whatsapp_url','address','phone','email','wifi_password')`
);
const config: Record<string, string> = {};
rows.forEach((r: any) => config[r.key] = r.value);
return NextResponse.json({ data: config });
}
const { rows } = await db.query('SELECT value FROM config WHERE key = $1', [key]);