add: questions timelines

This commit is contained in:
trisua 2025-04-13 12:15:14 -04:00
parent 5d53ceb09c
commit 063e33899e
22 changed files with 407 additions and 90 deletions

View file

@ -193,6 +193,27 @@
});
});
self.define("remove_question", async (_, id) => {
if (
!(await trigger("atto::confirm", [
"Are you sure you want to do this?",
]))
) {
return;
}
fetch(`/api/v1/questions/${id}`, {
method: "DELETE",
})
.then((res) => res.json())
.then((res) => {
trigger("atto::toast", [
res.ok ? "success" : "error",
res.message,
]);
});
});
// token switcher
self.define(
"set_login_account_tokens",