Refactor: Update category structure, mega menu, footer, and remove unused pages
- Move DURGO from ระบบน้ำ to อุปกรณ์ปรับอากาศ - Add -category suffix to อุปกรณ์ดับเพลิง and ฉนวนหุ้มท่อ category pages - Update Header mega menu with correct category slugs - Fix Footer layout: split categories to 2 columns, remove quick links - Delete unused pages: all-projects, join-us, services, product - All product images fixed to 1:1 aspect ratio
This commit is contained in:
31
src/pages/api/consent/index.ts
Normal file
31
src/pages/api/consent/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { APIRoute } from 'astro';
|
||||
|
||||
export const POST: APIRoute = async ({ request }) => {
|
||||
const consentData = await request.json();
|
||||
|
||||
const record = {
|
||||
id: crypto.randomUUID(),
|
||||
essential: consentData.essential ?? true,
|
||||
analytics: consentData.analytics ?? false,
|
||||
marketing: consentData.marketing ?? false,
|
||||
timestamp: consentData.timestamp || Date.now(),
|
||||
policyVersion: consentData.policyVersion || '1.0',
|
||||
ip: request.headers.get('x-forwarded-for') || 'unknown',
|
||||
userAgent: request.headers.get('user-agent') || 'unknown',
|
||||
createdAt: new Date().toISOString()
|
||||
};
|
||||
|
||||
console.log('[Consent Log]', JSON.stringify(record));
|
||||
|
||||
return new Response(JSON.stringify({ success: true, record }), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
};
|
||||
|
||||
export const GET: APIRoute = () => {
|
||||
return new Response(JSON.stringify({ error: 'Method not allowed' }), {
|
||||
status: 405,
|
||||
headers: { 'Content-Type': 'application/json', 'Allow': 'POST' },
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user