misc: add post deletion toast

This commit is contained in:
Xyphyn committed 2023-07-30 11:56:44 -07:00
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) {