Added support for footnotes and fixed category AJAX post

This commit is contained in:
Leon Mika 2026-03-29 10:45:45 +11:00
parent 023574aac6
commit 9b20665d11
4 changed files with 18 additions and 2 deletions

View file

@ -60,6 +60,16 @@ export default class PosteditController extends Controller {
try {
const formData = new FormData(this.element);
let data = Object.fromEntries(formData.entries());
// Special handling for categories
let categoryIDs = [];
for (let i of formData.entries()) {
if (i[0] === "category_ids") {
categoryIDs.push(parseInt(i[1]))
}
}
data["category_ids"] = categoryIDs;
data = {...data, action: action || 'save'};
const response = await fetch(this.element.getAttribute("action"), {