Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/start/framework/react/guide/rendering-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ type FetchDocsParams = {
}

export const fetchDocs = createServerFn({ method: 'GET' })
.validator((params: FetchDocsParams) => params)
.inputValidator((params: FetchDocsParams) => params)
.handler(async ({ data: { repo, branch, filePath } }) => {
const url = `https://raw.githubusercontent.com/${repo}/${branch}/${filePath}`

Expand Down Expand Up @@ -366,7 +366,7 @@ For production, add appropriate cache headers:

```tsx
export const fetchDocs = createServerFn({ method: 'GET' })
.validator((params: FetchDocsParams) => params)
.inputValidator((params: FetchDocsParams) => params)
.handler(async ({ data: { repo, branch, filePath }, context }) => {
// Set cache headers for CDN caching
context.response.headers.set(
Expand Down Expand Up @@ -428,7 +428,9 @@ type GitHubContent = {
}

export const fetchRepoContents = createServerFn({ method: 'GET' })
.validator((params: { repo: string; branch: string; path: string }) => params)
.inputValidator(
(params: { repo: string; branch: string; path: string }) => params,
)
.handler(async ({ data: { repo, branch, path } }) => {
const url = `https://api.github.com/repos/${repo}/contents/${path}?ref=${branch}`

Expand Down
Loading