rough implementations of Moment and Essay creation and viewing completed.
This commit is contained in:
@@ -18,6 +18,25 @@ window.addEventListener("click", () => {
|
||||
});
|
||||
});
|
||||
|
||||
function editPost(id) {
|
||||
fetch("director.php", {
|
||||
method: "POST",
|
||||
|
||||
// TODO: Add Authorization header with JWT
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
body: "ajaxId=editPostHTML&id=" + id,
|
||||
})
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
openModal(data["html"]);
|
||||
document.querySelector("#redirect").value = window.location.href;
|
||||
});
|
||||
}
|
||||
|
||||
function deleteSpace(id) {
|
||||
document.querySelector("#space-" + id).remove();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user