fix(board): surface delete errors via toast

This commit is contained in:
Jennie Robinson Faber 2026-04-14 17:38:32 +01:00
parent 5fb069a80e
commit 6f3d088763

View file

@ -147,7 +147,15 @@ const handleDelete = async (post) => {
if (typeof window === 'undefined') return if (typeof window === 'undefined') return
const ok = window.confirm('Delete this post? This cannot be undone.') const ok = window.confirm('Delete this post? This cannot be undone.')
if (!ok) return if (!ok) return
try {
await deletePost(post._id) await deletePost(post._id)
} catch (err) {
toast.add({
title: 'Failed to delete post',
description: err?.data?.message || err?.message || 'Please try again.',
color: 'red',
})
}
} }
const handleSubmit = async (body) => { const handleSubmit = async (body) => {