diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-17 12:21:08 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-17 12:21:08 +0900 |
| commit | 4c51b63201c5b28f38cbf9919c8a2826c095af9f (patch) | |
| tree | 2907c54ff8ced5cc026fca533c4a7749498824be /app | |
| parent | b9ce61033c2f5bc6ec8eb3db200b96058f013bf8 (diff) | |
(김준회) 오류 수정: route.ts에서 Promise 타입의 params를 await 처리
Diffstat (limited to 'app')
| -rw-r--r-- | app/api/partners/rfq-last/[id]/response/route.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/api/partners/rfq-last/[id]/response/route.ts b/app/api/partners/rfq-last/[id]/response/route.ts index 06ace9a0..ef83f4a3 100644 --- a/app/api/partners/rfq-last/[id]/response/route.ts +++ b/app/api/partners/rfq-last/[id]/response/route.ts @@ -36,7 +36,7 @@ async function saveFileStream(file: File, filepath: string) { export async function POST( request: NextRequest, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { const session = await getServerSession(authOptions) @@ -44,7 +44,8 @@ export async function POST( return NextResponse.json({ error: "Unauthorized" }, { status: 401 }) } - const rfqId = parseInt(params.id) + const { id } = await params + const rfqId = parseInt(id) const formData = await request.formData() const data = JSON.parse(formData.get('data') as string) const files = formData.getAll('attachments') as File[] @@ -284,7 +285,7 @@ export async function POST( export async function PUT( request: NextRequest, - { params }: { params: { id: string } } + { params }: { params: Promise<{ id: string }> } ) { try { const session = await getServerSession(authOptions) @@ -292,7 +293,8 @@ export async function PUT( return NextResponse.json({ error: "Unauthorized" }, { status: 401 }) } - const rfqId = parseInt(params.id) + const { id } = await params + const rfqId = parseInt(id) const formData = await request.formData() const data = JSON.parse(formData.get('data') as string) const files = formData.getAll('attachments') as File[] |
