Start to think about how to display errors
This commit is contained in:
@ -18,6 +18,7 @@ const $downloader = document.querySelector("a#downloader");
|
||||
const $uploader = document.querySelector("input#uploader");
|
||||
|
||||
let channels = [];
|
||||
let reminderErrors = [];
|
||||
let guildNames = {};
|
||||
let roles = [];
|
||||
let templates = {};
|
||||
@ -36,6 +37,12 @@ function guildId() {
|
||||
return document.querySelector(".guildList a.is-active").dataset["guild"];
|
||||
}
|
||||
|
||||
function loadErrors() {
|
||||
return fetch(`/dashboard/api/guild/${guildId()}/errors`).then((response) =>
|
||||
response.json()
|
||||
);
|
||||
}
|
||||
|
||||
function colorToInt(r, g, b) {
|
||||
return (r << 16) + (g << 8) + b;
|
||||
}
|
||||
@ -476,6 +483,9 @@ document.addEventListener("guildSwitched", async (e) => {
|
||||
fetch_roles(e.detail.guild_id);
|
||||
fetch_templates(e.detail.guild_id);
|
||||
fetch_reminders(e.detail.guild_id);
|
||||
loadErrors().then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
document.querySelectorAll("p.pageTitle").forEach((el) => {
|
||||
el.textContent = `${e.detail.guild_name} Reminders`;
|
||||
|
@ -1,19 +0,0 @@
|
||||
let _reminderErrors = [];
|
||||
|
||||
const reminderErrors = () => {
|
||||
return _reminderErrors;
|
||||
}
|
||||
|
||||
const guildId = () => {
|
||||
let selected = document.querySelector(".guildList a.is-active");
|
||||
return selected.dataset["guild"];
|
||||
}
|
||||
|
||||
|
||||
function loadErrors() {
|
||||
fetch(`/dashboard/api/guild/${guildId()}/errors`).then(response => response.json())
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
})
|
@ -1,19 +0,0 @@
|
||||
let _reminderErrors = [];
|
||||
|
||||
const reminderErrors = () => {
|
||||
return _reminderErrors;
|
||||
}
|
||||
|
||||
const guildId = () => {
|
||||
let selected: HTMLElement = document.querySelector(".guildList a.is-active");
|
||||
return selected.dataset["guild"];
|
||||
}
|
||||
|
||||
|
||||
function loadErrors() {
|
||||
fetch(`/dashboard/api/guild/${guildId()}/errors`).then(response => response.json())
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
})
|
Reference in New Issue
Block a user