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:
2026-08-15 18:46:26 +03:30
parent 67cba87661
commit 73670703bb
9 changed files with 263 additions and 57 deletions
+13
View File
@@ -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)