old-category field is doesn't needed anymore as well.
This commit is contained in:
parent
a81375fc34
commit
2d3022aa27
@ -6,7 +6,6 @@ function edit_post(e) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let data = new URLSearchParams();
|
let data = new URLSearchParams();
|
||||||
data.append("category", get_field(e.target, "category"))
|
data.append("category", get_field(e.target, "category"))
|
||||||
data.append("old-category", get_field(e.target, "old-category"))
|
|
||||||
data.append("title", get_field(e.target, "title"))
|
data.append("title", get_field(e.target, "title"))
|
||||||
data.append("body", get_field(e.target, "body"))
|
data.append("body", get_field(e.target, "body"))
|
||||||
fetch(`/api/mindflow/${get_field(e.target, "post-id")}`, {method: "PATCH", body: data})
|
fetch(`/api/mindflow/${get_field(e.target, "post-id")}`, {method: "PATCH", body: data})
|
||||||
|
@ -54,7 +54,6 @@ block content
|
|||||||
else
|
else
|
||||||
option(value=category.ID) #{category.Name}
|
option(value=category.ID) #{category.Name}
|
||||||
input(type='hidden', name='post-id' value=post.ID)
|
input(type='hidden', name='post-id' value=post.ID)
|
||||||
input(type='hidden', name='old-category' value=post.Category.ID)
|
|
||||||
input(type='text', placeholder='Title' name='title' value=post.Title required='')
|
input(type='text', placeholder='Title' name='title' value=post.Title required='')
|
||||||
textarea(placeholder='Body post' name='body' required='')!= post.Body
|
textarea(placeholder='Body post' name='body' required='')!= post.Body
|
||||||
button(name='edit-post') Edit
|
button(name='edit-post') Edit
|
||||||
|
Loading…
Reference in New Issue
Block a user