diff --git a/app/api/quiz-submission/route.ts b/app/api/quiz-submission/route.ts index b6b50e7..c4a4d66 100644 --- a/app/api/quiz-submission/route.ts +++ b/app/api/quiz-submission/route.ts @@ -1,6 +1,6 @@ import { cookies } from 'next/headers'; import { createClient } from '@/utils/supabase/server'; -import { NextRequest } from 'next/server'; +import { NextRequest, NextResponse } from 'next/server'; import { z } from 'zod'; export async function POST(request: NextRequest) { @@ -17,7 +17,7 @@ export async function POST(request: NextRequest) { ); if (!validateBody.success) { - return Response.json( + return NextResponse.json( { error: '필드가 올바르지 않습니다.' }, { status: 400 } ); @@ -30,7 +30,10 @@ export async function POST(request: NextRequest) { } = await supabase.auth.getUser(); if (!user) { - return Response.json({ error: '로그인이 필요합니다.' }, { status: 401 }); + return NextResponse.json( + { error: '로그인이 필요합니다.' }, + { status: 401 } + ); } const { data: answerChoice } = await supabase @@ -47,11 +50,11 @@ export async function POST(request: NextRequest) { }); if (choiceId !== answerChoice?.id) { - return Response.json( + return NextResponse.json( { error: '틀렸어요! 다시 고민해주세요.' }, { status: 400 } ); } - return Response.json({ data: '정답!' }); + return NextResponse.json({ data: '정답!' }); } diff --git a/app/layout.tsx b/app/layout.tsx index 5d19e2a..8271aef 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,7 +1,8 @@ import { GeistSans } from 'geist/font/sans'; import './globals.css'; -import QueryProvider from '@/providers/QueryProvider'; +import QueryProvider from '@/providers/query-provider'; import { PcScreen } from '@/components/pc-screen'; +import OverlayProvider from '@/providers/overlay-provider'; const defaultUrl = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` @@ -27,7 +28,8 @@ export default function RootLayout({