Add rooms, menu, places, reviews APIs and site config bulk endpoint
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user