Integrate add content page into backend
The page can be found under `/add`.
This commit is contained in:
@@ -46,11 +46,14 @@ form.addEventListener("submit", e => {
|
||||
fetch("/api/v1/datasets", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(newContent),
|
||||
headers: {
|
||||
"Content-Type": "application/json;charset=utf-8"
|
||||
}
|
||||
}).then(response => {
|
||||
if (response.status == 200) {
|
||||
location.assign("/");
|
||||
} else {
|
||||
addBtn.disabled = !checkValidity();
|
||||
addBtn.disabled = !form.checkValidity();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user