|
|
|
|
@ -4,11 +4,15 @@ import { z } from 'zod'
|
|
|
|
|
|
|
|
|
|
export const POST = async ({ locals, request }) => {
|
|
|
|
|
const type = request.headers.get('Content-Type')
|
|
|
|
|
console.log(type)
|
|
|
|
|
if (type !== 'application/json') return new Response()
|
|
|
|
|
console.log('Type:', type)
|
|
|
|
|
if (type !== 'application/json; charset=utf-8') {
|
|
|
|
|
return new Response()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const body = await request.json()
|
|
|
|
|
|
|
|
|
|
console.log('Body:', body)
|
|
|
|
|
|
|
|
|
|
const flatSchema = z.object({
|
|
|
|
|
type: z.literal('Flat'),
|
|
|
|
|
key: z.string(),
|
|
|
|
|
|