refactor(board): accept refresh params in useBoardPosts mutators

This commit is contained in:
Jennie Robinson Faber 2026-04-14 17:19:48 +01:00
parent 61d33f5db3
commit 698f786951
2 changed files with 7 additions and 8 deletions

View file

@ -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
}