File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,20 @@ React [Server Actions](https://react.dev/reference/rsc/server-functions) let cli
1212Define your procedure with ` .actionable ` for Server Action support.
1313
1414``` ts twoslash
15- import { onError , os } from ' @orpc/server'
15+ import { onError , onSuccess , os } from ' @orpc/server'
1616import { z } from ' zod'
1717// ---cut---
1818' use server'
1919
20+ import { redirect } from ' next/navigation'
21+
2022export const ping = os
2123 .input (z .object ({ name: z .string () }))
2224 .handler (async ({ input }) => ` Hello, ${input .name } ` )
2325 .actionable ({
2426 context : async () => ({}), // Optional: provide initial context if needed
2527 interceptors: [
28+ onSuccess (output => redirect (` /some-where ` )),
2629 onError (error => console .error (error )),
2730 ],
2831 })
You can’t perform that action at this time.
0 commit comments