Added support for footnotes and fixed category AJAX post
This commit is contained in:
parent
023574aac6
commit
9b20665d11
4 changed files with 18 additions and 2 deletions
|
|
@ -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"), {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue