2023-08-27 16:41:23 +00:00
|
|
|
function loadErrors() {
|
2023-09-03 14:01:42 +00:00
|
|
|
return fetch(
|
2023-09-03 15:00:49 +00:00
|
|
|
`/dashboard/api/guild/${guildId()}/reminders?status=deleted,sent,failed`
|
2023-09-03 14:01:42 +00:00
|
|
|
).then((response) => response.json());
|
2023-08-27 16:41:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener("paneLoad", (ev) => {
|
2023-09-03 14:01:42 +00:00
|
|
|
if (ev.detail.pane !== "errors") {
|
2023-08-27 16:41:23 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-09-03 15:00:49 +00:00
|
|
|
document.querySelectorAll(".reminderError").forEach((el) => el.remove());
|
|
|
|
|
|
|
|
const template = document.getElementById("reminderError");
|
|
|
|
const container = document.getElementById("reminderLog");
|
|
|
|
|
2023-09-03 14:01:42 +00:00
|
|
|
loadErrors().then((res) => {
|
2023-09-03 15:00:49 +00:00
|
|
|
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);
|
|
|
|
}
|
2023-09-03 14:01:42 +00:00
|
|
|
});
|
2023-08-27 16:41:23 +00:00
|
|
|
|
|
|
|
$loader.classList.add("is-hidden");
|
|
|
|
});
|