Some checks failed
CI / Check typos (push) Successful in 1m3s
CI / Check links (push) Failing after 1m14s
CI / Clippy (push) Successful in 1m43s
CI / Build and test (push) Successful in 1m31s
CI / Build container (push) Successful in 1m45s
CI / Deploy on waypoint (push) Failing after 1m23s
11 lines
310 B
JavaScript
11 lines
310 B
JavaScript
htmx.defineExtension('json-enc', {
|
|
onEvent: function (name, evt) {
|
|
if (name === "htmx:configRequest") {
|
|
evt.detail.headers['Content-Type'] = "application/json";
|
|
}
|
|
},
|
|
encodeParameters: function (xhr, parameters, elt) {
|
|
xhr.overrideMimeType('text/json');
|
|
return (JSON.stringify(parameters));
|
|
}
|
|
}); |