Move errors route into get_reminders route. Add database migration.
This commit is contained in:
@ -57,7 +57,7 @@ function switch_pane(selector) {
|
||||
el.classList.add("is-hidden");
|
||||
});
|
||||
|
||||
document.getElementById(selector).classList.remove("is-hidden");
|
||||
document.querySelector(`*[data-name=${selector}]`).classList.remove("is-hidden");
|
||||
}
|
||||
|
||||
function update_select(sel) {
|
||||
@ -735,16 +735,19 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
});
|
||||
}
|
||||
|
||||
const matches = window.location.href.match(/dashboard\/(\d+)/);
|
||||
const matches = window.location.href.match(
|
||||
/dashboard\/(\d+)(\/)?([a-zA-Z\-]+)?/
|
||||
);
|
||||
if (matches) {
|
||||
let id = matches[1];
|
||||
let kind = matches[3];
|
||||
let name = guildNames[id];
|
||||
|
||||
const event = new CustomEvent("guildSwitched", {
|
||||
detail: {
|
||||
guild_name: name,
|
||||
guild_id: id,
|
||||
pane: "guild",
|
||||
pane: kind,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -1,16 +1,18 @@
|
||||
function loadErrors() {
|
||||
return fetch(`/dashboard/api/guild/${guildId()}/errors`).then((response) =>
|
||||
response.json()
|
||||
);
|
||||
return fetch(
|
||||
`/dashboard/api/guild/${guildId()}/reminders?status=deleted,sent,error`
|
||||
).then((response) => response.json());
|
||||
}
|
||||
|
||||
document.addEventListener("paneLoad", (ev) => {
|
||||
if (ev.detail.pane !== "reminder-errors") {
|
||||
if (ev.detail.pane !== "errors") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load errors
|
||||
loadErrors().then((res) => {});
|
||||
loadErrors().then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
$loader.classList.add("is-hidden");
|
||||
});
|
||||
|
Reference in New Issue
Block a user