미저장 변경 이탈 확인 추가
This commit is contained in:
@@ -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 || '글을 삭제하지 못했습니다.'
|
||||
|
||||
@@ -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: '글이 저장되었습니다.'
|
||||
|
||||
Reference in New Issue
Block a user