add: improved admin functions

This commit is contained in:
Lukian 2025-04-20 19:52:05 +02:00
parent 4501f38b03
commit 1ec185330d
6 changed files with 87 additions and 2 deletions

View file

@ -42,6 +42,9 @@ export default function ChannelPage({socket}: {socket: WebSocket}) {
}
function purgeChannel() {
if (!window.confirm(`Are you sure you want to purge ${channel?.name}?`)) {
return;
}
axios
.post(`/api/channels/${name}/purge`, { token })
.catch((err) => {
@ -51,6 +54,9 @@ export default function ChannelPage({socket}: {socket: WebSocket}) {
}
function deleteChannel() {
if (!window.confirm(`Are you sure you want to delete ${channel?.name}?`)) {
return;
}
axios
.post(`/api/channels/${name}/delete`, { token })
.then(() => {