|
|
|
@ -4,16 +4,9 @@ import { z } from 'zod'
|
|
|
|
|
|
|
|
|
|
|
|
export const POST = async ({ locals, request }) => {
|
|
|
|
export const POST = async ({ locals, request }) => {
|
|
|
|
const type = request.headers.get('Content-Type')
|
|
|
|
const type = request.headers.get('Content-Type')
|
|
|
|
|
|
|
|
if (type !== 'application/json') return new Response()
|
|
|
|
|
|
|
|
|
|
|
|
console.log('type', type)
|
|
|
|
const body = await request.json()
|
|
|
|
|
|
|
|
|
|
|
|
const text = await request.text()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('text', text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const body = JSON.parse(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('text', body)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const flatSchema = z.object({
|
|
|
|
const flatSchema = z.object({
|
|
|
|
type: z.literal('Flat'),
|
|
|
|
type: z.literal('Flat'),
|
|
|
|
|