misc: add post deletion toast
This commit is contained in:
1 parent
eb1d90478e
commit
32712689d1
1 file changed
+16
-5
@@ -36,11 +36,22 @@
|
||||
async function deletePost() {
|
||||
if (!$authData) return
|
||||
|
||||
await getClient().deletePost({
|
||||
auth: $authData.token,
|
||||
deleted: true,
|
||||
post_id: post.post.id,
|
||||
})
|
||||
try {
|
||||
await getClient().deletePost({
|
||||
auth: $authData.token,
|
||||
deleted: true,
|
||||
post_id: post.post.id,
|
||||
})
|
||||
toast({
|
||||
content: 'That post was deleted.',
|
||||
type: ToastType.success,
|
||||
})
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: err as any,
|
||||
type: ToastType.error,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function save(post: PostView) {
|
||||
|
||||
Reference in new issue
Block a user