Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-12 12:39:47 +08:00
parent 71f758fe0b
commit fa92d924f4
50 changed files with 2202 additions and 2623 deletions
+5 -3
View File
@@ -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) {