예약 발행 기능 추가

This commit is contained in:
2026-05-03 09:58:27 +09:00
parent db87542096
commit 60f9fd52f0
11 changed files with 151 additions and 9 deletions

View File

@@ -21,6 +21,14 @@ if (!post.value) {
})
}
/**
* 공개 화면에서 접근 가능한 게시물 여부 확인
* @param {Object} value - 게시물
* @returns {boolean} 공개 접근 가능 여부
*/
const isPublicPost = (value) => value?.status === 'published'
&& (!value.publishedAt || new Date(value.publishedAt) <= new Date())
/**
* 저장 상태 토스트 표시
* @param {'success'|'error'|'info'} type - 토스트 타입
@@ -127,7 +135,7 @@ onBeforeUnmount(() => {
</div>
<div class="admin-post-edit__actions flex gap-2">
<NuxtLink
v-if="post.status === 'published'"
v-if="isPublicPost(post)"
class="admin-post-edit__view rounded border border-line bg-white px-4 py-2 text-sm font-semibold"
:to="`/post/${post.slug}`"
target="_blank"