MCPcopy Create free account
hub / github.com/TanStack/router / fetchPost

Function fetchPost

e2e/solid-router/generator-cli-only/src/posts.ts:24–36  ·  view source on GitHub ↗
(postId: string)

Source from the content-addressed store, hash-verified

22}
23
24export const fetchPost = async (postId: string) => {
25 console.info(`Fetching post with id ${postId}...`)
26 const post = await axios
27 .get<PostType>(`${queryURL}/posts/${postId}`)
28 .then((r) => r.data)
29
30 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
31 if (!post) {
32 throw new NotFoundError(`Post with id "${postId}" not found!`)
33 }
34
35 return post
36}

Callers 1

posts.$postId.tsxFile · 0.90

Calls 2

infoMethod · 0.65
thenMethod · 0.65

Tested by

no test coverage detected