예약 발행 기능 추가
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user