Merge remote-tracking branch 'origin/main' into feature/140

This commit is contained in:
2026-01-29 23:53:37 +09:00
110 changed files with 4918 additions and 820 deletions
+21 -8
View File
@@ -6,16 +6,29 @@ import { API_BASE_URL } from '@/config'
import type { Post } from '@/types'
export const fetchPosts = async ({ tags, match, limit, cursor }: {
tags: string
match: 'any' | 'all'
limit: number
cursor?: string }): Promise<{ posts: Post[]; nextCursor: string }> => {
export const fetchPosts = async (
{ tags, match, page, limit, cursor }: {
tags: string
match: 'any' | 'all'
page?: number
limit?: number
cursor?: string }
): Promise<{
posts: Post[]
count: number
nextCursor: string }> => {
const res = await axios.get (`${ API_BASE_URL }/posts`, {
params: { tags, match, limit, ...(cursor && { cursor }) } })
params: {
tags,
match,
...(page && { page }),
...(limit && { limit }),
...(cursor && { cursor }) } })
return toCamel (res.data as any, { deep: true }) as { posts: Post[]
nextCursor: string }
return toCamel (res.data as any, { deep: true }) as {
posts: Post[]
count: number
nextCursor: string }
}