Skip to content

Commit 0996b9c

Browse files
committed
chore: restore
1 parent 1b52091 commit 0996b9c

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

packages/velog-web/src/app/(list)/recent/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export const metadata: Metadata = {
99
}
1010

1111
export default async function RecentHome() {
12-
// const data = await getRecentPosts({ limit: 50 })
12+
const data = await getRecentPosts({ limit: 50 })
1313

14-
// if (!data) {
15-
// notFound()
16-
// }
14+
if (!data) {
15+
notFound()
16+
}
1717

18-
return <RecentPosts data={[]} />
18+
return <RecentPosts data={data} />
1919
}

packages/velog-web/src/features/home/components/RecentPosts/RecentPosts.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { useEffect, useRef, useState } from 'react'
66
import { Post } from '@/graphql/helpers/generated'
77

88
type Props = {
9-
data: any[]
9+
data: Post[]
1010
}
1111

1212
function RecentPosts({ data }: Props) {
1313
const hasEffectRun = useRef<boolean>(false)
1414

1515
const [initialData, setInitialData] = useState<Post[]>([])
16-
const { posts, isFetching, fetchMore, isLoading } = useRecentPosts(initialData as Post[])
16+
const { posts, isFetching, fetchMore, isLoading } = useRecentPosts(initialData)
1717

1818
useEffect(() => {
1919
if (hasEffectRun.current) return
@@ -25,13 +25,13 @@ function RecentPosts({ data }: Props) {
2525
const infiniteData = localStorage.getItem(storageKey)
2626

2727
if (!infiniteData) {
28-
setInitialData(data as any)
28+
setInitialData(data)
2929
return
3030
}
3131

3232
const parsed: Post[] = JSON.parse(infiniteData) || []
3333
const savedPosts = parsed?.slice(data.length) || []
34-
setInitialData([...data, ...savedPosts] as Post[])
34+
setInitialData([...data, ...savedPosts])
3535

3636
const position = Number(localStorage.getItem(`${storageKey}/scrollPosition`))
3737
if (!position) return

packages/velog-web/src/prefetch/getNotificationCount.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default async function getNotificationCount(): Promise<number> {
2323
const { notNoticeNotificationCount } = await graphqlFetch<{
2424
notNoticeNotificationCount: number
2525
}>({
26+
method: 'GET',
2627
body,
2728
next: { revalidate: 0 },
2829
})

packages/velog-web/src/prefetch/getUser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default async function getUser(username: string) {
1414
}
1515

1616
const { user } = await graphqlFetch<{ user: User }>({
17+
method: 'GET',
1718
body,
1819
next: { revalidate: 0 },
1920
})

packages/velog-web/src/prefetch/getUserFollowInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default async function getUserFollowInfo(username: string) {
1515
}
1616

1717
const { user } = await graphqlFetch<{ user: User }>({
18+
method: 'GET',
1819
body,
1920
next: { revalidate: 0 },
2021
})

packages/velog-web/src/prefetch/getUserTags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default async function getUserTags(username: string) {
2121
}
2222

2323
const { userTags } = await graphqlFetch<{ userTags: UserTags }>({
24+
method: 'GET',
2425
body,
2526
next: { revalidate: 20 },
2627
headers,

packages/velog-web/src/prefetch/getVelogPosts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default async function getVelogPosts({ username, tag }: GetVelogPostsArgs
2323
}
2424

2525
const { posts } = await graphqlFetch<{ posts: Post[] }>({
26+
method: 'GET',
2627
body,
2728
next: { revalidate: 0 },
2829
headers,

0 commit comments

Comments
 (0)