diff --git a/app/composables/useBoardPosts.js b/app/composables/useBoardPosts.js index e8a7087..9fc74ac 100644 --- a/app/composables/useBoardPosts.js +++ b/app/composables/useBoardPosts.js @@ -17,29 +17,29 @@ export function useBoardPosts() { } } - async function createPost(body) { + async function createPost(body, refreshParams = {}) { const created = await $fetch('/api/board/posts', { method: 'POST', body, }) - await fetchPosts() + await fetchPosts(refreshParams) return created } - async function updatePost(id, body) { + async function updatePost(id, body, refreshParams = {}) { const updated = await $fetch(`/api/board/posts/${id}`, { method: 'PATCH', body, }) - await fetchPosts() + await fetchPosts(refreshParams) return updated } - async function deletePost(id) { + async function deletePost(id, refreshParams = {}) { const result = await $fetch(`/api/board/posts/${id}`, { method: 'DELETE', }) - await fetchPosts() + await fetchPosts(refreshParams) return result } diff --git a/app/pages/member/profile.vue b/app/pages/member/profile.vue index 384c186..b7abcbe 100644 --- a/app/pages/member/profile.vue +++ b/app/pages/member/profile.vue @@ -441,8 +441,7 @@ const postExcerpt = (post) => { const handleDeletePost = async (post) => { if (!window.confirm(`Delete "${post.title}"?`)) return; try { - await deletePost(post._id); - await fetchPosts({ author: memberId.value }); + await deletePost(post._id, { author: memberId.value }); } catch (error) { console.error("Delete post error:", error); toast.add({