Skip to content

Commit

Permalink
fix: fixes elements theme mutlipart form file upload (#864)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Weilharter <[email protected]>
  • Loading branch information
wlhrtr and Peter Weilharter authored Jul 11, 2024
1 parent 87c2dbd commit 7f7b74a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/views/themes/elements/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ function tryItOut(btnElement) {
});
}
// content type has to be unset otherwise file upload won't work
if (form.dataset.hasfiles === "1") {
delete headers['Content-Type'];
}
return preflightPromise.then(() => makeAPICall(method, path, body, query, headers, endpointId))
.then(([responseStatus, statusText, responseContent, responseHeaders]) => {
responsePanel.hidden = false;
Expand Down

0 comments on commit 7f7b74a

Please sign in to comment.