fix: align FilePond upload with the Node.js API and proxy gallery previews
Use the filepond-image field, parse the API envelope, and load private files through the authenticated content endpoint so uploads persist and images display.
This commit is contained in:
@@ -29,6 +29,19 @@ axiosInstance.interceptors.request.use(
|
||||
config.params.lang = lang;
|
||||
}
|
||||
|
||||
const isFormData = typeof FormData !== 'undefined' && config.data instanceof FormData;
|
||||
if (isFormData) {
|
||||
// Let the browser set multipart boundary — a bare multipart/form-data header breaks Multer
|
||||
if (typeof config.headers?.delete === 'function') {
|
||||
config.headers.delete('Content-Type');
|
||||
config.headers.delete('content-type');
|
||||
} else {
|
||||
delete config.headers['Content-Type'];
|
||||
delete config.headers['content-type'];
|
||||
}
|
||||
config.timeout = Math.max(config.timeout || 0, 120000);
|
||||
}
|
||||
|
||||
return config;
|
||||
},
|
||||
(error) => Promise.reject(error)
|
||||
|
||||
Reference in New Issue
Block a user