From 45468413d32f5155392b77d53c8ac44e4d51ccdf Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Wed, 18 May 2022 09:30:18 -0700 Subject: [PATCH] update recipes --- recipes/authorization.md | 6 +++--- recipes/validation.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/authorization.md b/recipes/authorization.md index ccdeb4c..2bbf89c 100644 --- a/recipes/authorization.md +++ b/recipes/authorization.md @@ -2,7 +2,7 @@ The `createContext`-function is called for each incoming request so here you can add contextual information about the calling user from the request object. -## Create context from request headers +### Create context from request headers ```ts // ~/server/trpc/index.ts @@ -35,7 +35,7 @@ type Context = trpc.inferAsyncReturnType // [..] Define API handler and app router ``` -## Option 1: Authorize using resolver +### Option 1: Authorize using resolver ```ts export const router = trpc @@ -60,7 +60,7 @@ export const router = trpc }) ``` -## Option 2: Authorize using middleware +### Option 2: Authorize using middleware ```ts import * as trpc from '@trpc/server' diff --git a/recipes/validation.md b/recipes/validation.md index 99856fb..dd810f1 100644 --- a/recipes/validation.md +++ b/recipes/validation.md @@ -2,7 +2,7 @@ tRPC works out-of-the-box with yup/superstruct/zod/myzod/custom validators. -## Input Validation +### Input Validation ```ts // ~/server/trpc/index.ts @@ -24,7 +24,7 @@ export const router = trpc }) ``` -## Output Validation +### Output Validation ```ts // ~/server/trpc/index.ts