Render log rows
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
function loadErrors() {
|
||||
return fetch(
|
||||
`/dashboard/api/guild/${guildId()}/reminders?status=deleted,sent,error`
|
||||
`/dashboard/api/guild/${guildId()}/reminders?status=deleted,sent,failed`
|
||||
).then((response) => response.json());
|
||||
}
|
||||
|
||||
@ -9,9 +9,20 @@ document.addEventListener("paneLoad", (ev) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load errors
|
||||
document.querySelectorAll(".reminderError").forEach((el) => el.remove());
|
||||
|
||||
const template = document.getElementById("reminderError");
|
||||
const container = document.getElementById("reminderLog");
|
||||
|
||||
loadErrors().then((res) => {
|
||||
console.log(res);
|
||||
for (const reminder of res) {
|
||||
const newRow = template.content.cloneNode(true);
|
||||
|
||||
newRow.querySelector(".reminderName").textContent = reminder.name;
|
||||
newRow.querySelector(".reminderError").dataset["case"] = reminder.status;
|
||||
|
||||
container.appendChild(newRow);
|
||||
}
|
||||
});
|
||||
|
||||
$loader.classList.add("is-hidden");
|
||||
|
Reference in New Issue
Block a user