미저장 변경 이탈 확인 추가

This commit is contained in:
2026-05-13 11:29:11 +09:00
parent fb0dadb7b9
commit 79d0a30475
12 changed files with 258 additions and 9 deletions

View File

@@ -95,6 +95,7 @@ const savePost = async (payload) => {
})
post.value = updatedPost
postForm.value?.markSaved()
postForm.value?.clearAutosave()
showToast('success', '변경 내용이 저장되었습니다.')
} catch (error) {
@@ -122,6 +123,7 @@ const deletePost = async () => {
await $fetch(`/admin/api/posts/${id.value}`, {
method: 'DELETE'
})
postForm.value?.allowNextRouteLeave()
await navigateTo('/admin/posts')
} catch (error) {
errorMessage.value = error?.data?.message || '글을 삭제하지 못했습니다.'

View File

@@ -52,7 +52,9 @@ const savePost = async (payload) => {
body: payload
})
postForm.value?.markSaved()
postForm.value?.clearAutosave()
postForm.value?.allowNextRouteLeave()
sessionStorage.setItem('SORI_ADMIN_POST_TOAST', JSON.stringify({
type: 'success',
message: '글이 저장되었습니다.'