diff --git a/src/app/api/qna/save/route.ts b/src/app/api/qna/save/route.ts index 00633bd..3afc339 100644 --- a/src/app/api/qna/save/route.ts +++ b/src/app/api/qna/save/route.ts @@ -3,17 +3,19 @@ import { NextResponse } from 'next/server' export async function POST(request: Request) { const formData = await request.formData() - console.log('formData:: ', formData) - try { - const response = await axios.post(`${process.env.NEXT_PUBLIC_INQUIRY_API_URL}/api/qna/save`, formData) - + const response = await axios.post(`${process.env.NEXT_PUBLIC_INQUIRY_API_URL}/api/qna/save`, formData, { + headers: { + 'Content-Type': 'multipart/form-data', + }, + }) + console.log('response:: ', response) if (response.status === 200) { return NextResponse.json(response.data) } return NextResponse.json({ error: response.data }, { status: response.status }) - } catch (error) { - console.error('error:: ', error) + } catch (error: any) { + console.error('error:: ', error.response) return NextResponse.json({ error: 'Failed to save qna' }, { status: 500 }) } } diff --git a/src/components/inquiry/Detail.tsx b/src/components/inquiry/Detail.tsx index 9bb22b4..850cc6d 100644 --- a/src/components/inquiry/Detail.tsx +++ b/src/components/inquiry/Detail.tsx @@ -69,11 +69,6 @@ export default function Detail() { ))} -
  • - -
  • diff --git a/src/components/inquiry/list/ListTable.tsx b/src/components/inquiry/list/ListTable.tsx index eed1d34..c12cf61 100644 --- a/src/components/inquiry/list/ListTable.tsx +++ b/src/components/inquiry/list/ListTable.tsx @@ -48,7 +48,7 @@ export default function ListTable() { } else { setHeldInquiryList([]) } - }, [inquiryList, offset]) + }, [inquiryList, offset, setHeldInquiryList]) const handleMyInquiry = () => { setInquiryListRequest({ ...inquiryListRequest, schRegId: inquiryListRequest.schRegId ? null : session.userId })