fix: send empty JSON body on convert to avoid body-parser 400
postJSON without options sends Content-Type: application/json with no body; body-parser's BodyParserWrapper intercepts the resulting SyntaxError and returns 400 before the route handler runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,9 @@ export default function useConvertDoc(
|
||||
setConverting(true)
|
||||
hideExportDocumentError()
|
||||
try {
|
||||
await postJSON(`/project/${projectId}/doc/${docId}/convert/${type}`)
|
||||
await postJSON(`/project/${projectId}/doc/${docId}/convert/${type}`, {
|
||||
body: {},
|
||||
})
|
||||
// File tree updates automatically via socket event
|
||||
} catch (err: any) {
|
||||
const errorMessage = err?.data?.error
|
||||
|
||||
Reference in New Issue
Block a user