full release edit capabilities oh my goodness gracious

Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
ari melody 2024-08-31 01:30:30 +01:00
parent 34cddcfdb2
commit 604e2a4a7c
25 changed files with 1043 additions and 202 deletions

24
admin/static/index.js Normal file
View file

@ -0,0 +1,24 @@
const newReleaseBtn = document.getElementById("create-release");
newReleaseBtn.addEventListener("click", event => {
event.preventDefault();
const id = prompt("Enter an ID for this release:");
if (id == null || id == "") return;
fetch("/api/v1/music", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({id})
}).then(res => {
if (res.ok) location = "/admin/release/" + id;
else {
res.text().then(err => {
alert("Request failed: " + err);
console.error(err);
});
}
}).catch(err => {
alert("Failed to create release. Check the console for details.");
console.error(err);
});
});