예약 발행 기능 추가

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

@@ -158,6 +158,10 @@ export const listPosts = async () => {
LEFT JOIN post_tags ON post_tags.post_id = posts.id
LEFT JOIN tags ON tags.id = post_tags.tag_id
WHERE posts.status = 'published'
AND (
posts.published_at IS NULL
OR posts.published_at <= now()
)
GROUP BY posts.id
ORDER BY posts.published_at DESC NULLS LAST, posts.created_at DESC
`
@@ -343,6 +347,10 @@ export const getPostBySlug = async (slug) => {
LEFT JOIN tags ON tags.id = post_tags.tag_id
WHERE posts.slug = ${slug}
AND posts.status = 'published'
AND (
posts.published_at IS NULL
OR posts.published_at <= now()
)
GROUP BY posts.id
LIMIT 1
`