Skip to content

Commit 7b03a2c

Browse files
committed
fix: revalidate in posts
1 parent a3d04ba commit 7b03a2c

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

packages/velog-web/src/lib/graphqlFetch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export default async function graphqlFetch<T>({
1818

1919
const defaultHeaders = {
2020
'Content-Type': 'application/json',
21-
Accept: 'application/json',
2221
}
2322

2423
const combinedHeaders = new Headers({

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async function getRecentPosts({ limit = ENV.defaultPostLimit }: R
1717
const { recentPosts } = await graphqlFetch<{ recentPosts: Post[] }>({
1818
method: 'POST',
1919
body,
20-
next: { revalidate: 0 },
20+
next: { revalidate: 1 },
2121
})
2222

2323
return recentPosts

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use server'
2+
13
import { ENV } from '@/env'
24
import { Post, TrendingPostsDocument, TrendingPostsInput } from '@/graphql/helpers/generated'
35
import graphqlFetch, { GraphqlRequestBody } from '@/lib/graphqlFetch'
@@ -23,7 +25,7 @@ export default async function getTrendingPosts({
2325
const { trendingPosts } = await graphqlFetch<{ trendingPosts: Post[] }>({
2426
method: 'GET',
2527
body,
26-
cache: 'no-cache',
28+
next: { revalidate: 10 },
2729
})
2830

2931
return trendingPosts

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default async function getVelogPosts({ username, tag }: GetVelogPostsArgs
2525
const { posts } = await graphqlFetch<{ posts: Post[] }>({
2626
method: 'GET',
2727
body,
28-
next: { revalidate: 0 },
28+
next: { revalidate: 1 },
2929
headers,
3030
})
3131

0 commit comments

Comments
 (0)