Skip to content

Commit 4329e69

Browse files
committed
Added missing return keyword for undefined result
1 parent c809524 commit 4329e69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

next04/lib/getUserPosts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default async function getUserPosts(userId: string) {
22
const res = await fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`, { next: { revalidate: 60 } })
33

4-
if (!res.ok) undefined
4+
if (!res.ok) return undefined
55

66
return res.json()
77
}

0 commit comments

Comments
 (0)