사용자 이동과 미디어 선택 개선

This commit is contained in:
2026-07-06 11:29:12 +09:00
parent 8a774a1874
commit 9952a05ec2
12 changed files with 335 additions and 63 deletions

View File

@@ -1086,7 +1086,7 @@ export const getPostBySlug = async (slug, { includeMembership = false } = {}) =>
}
/**
* 공개 게시물 상세의 이전(더 최신)·다음(더 예전) 글을 조회한다.
* 공개 게시물 상세의 이전(더 예전)·다음(더 최신) 글을 조회한다.
* 목록과 같은 정렬(발행일 DESC) 기준으로 인접 글의 제목·슬러그만 반환한다.
* @param {string} slug - 기준 게시물 슬러그
* @param {{ includeMembership?: boolean }} [options] - 조회 옵션
@@ -1109,8 +1109,8 @@ export const getAdjacentPosts = async (slug, { includeMembership = false } = {})
}
const toNeighbor = (post) => (post ? { title: post.title, slug: post.slug } : null)
return {
previous: index > 0 ? toNeighbor(samplePosts[index - 1]) : null,
next: index < samplePosts.length - 1 ? toNeighbor(samplePosts[index + 1]) : null
previous: index < samplePosts.length - 1 ? toNeighbor(samplePosts[index + 1]) : null,
next: index > 0 ? toNeighbor(samplePosts[index - 1]) : null
}
}
@@ -1147,8 +1147,8 @@ export const getAdjacentPosts = async (slug, { includeMembership = false } = {})
}
return {
previous: row.previous_slug ? { title: row.previous_title, slug: row.previous_slug } : null,
next: row.next_slug ? { title: row.next_title, slug: row.next_slug } : null
previous: row.next_slug ? { title: row.next_title, slug: row.next_slug } : null,
next: row.previous_slug ? { title: row.previous_title, slug: row.previous_slug } : null
}
}