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

Function fetchPost

e2e/solid-router/js-only-file-based/src/posts.js:16–27  ·  view source on GitHub ↗
(postId)

Source from the content-addressed store, hash-verified

14}
15
16export const fetchPost = async (postId) => {
17 console.info(`Fetching post with id ${postId}...`)
18 const post = await axios
19 .get(`${queryURL}/posts/${postId}`)
20 .then((r) => r.data)
21
22 if (!post) {
23 throw new NotFoundError(`Post with id "${postId}" not found!`)
24 }
25
26 return post
27}

Callers 2

posts.$postId.jsxFile · 0.90
posts.$postId.tsxFile · 0.90

Calls 3

infoMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected