mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -218,9 +218,11 @@ export function AssetsProvider({ children }) {
|
||||
});
|
||||
if (file) formData.append("file", file);
|
||||
|
||||
const res = await api.patch(`/admin/assets/${assetId}`, formData, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
// No explicit Content-Type here — axios/the browser must set it
|
||||
// itself so the multipart boundary is included. A hardcoded
|
||||
// "multipart/form-data" header (no boundary) makes multer fail
|
||||
// to parse the body, silently dropping the file and every field.
|
||||
const res = await api.patch(`/admin/assets/${assetId}`, formData);
|
||||
|
||||
const asset = res.data?.data?.data ?? null;
|
||||
if (asset) {
|
||||
|
||||
Reference in New Issue
Block a user