generated from lucien/api-template
add: improved admin functions
This commit is contained in:
parent
4501f38b03
commit
1ec185330d
6 changed files with 87 additions and 2 deletions
|
@ -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(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue