Skip to content

Commit

Permalink
feat: replace useBody with readBody
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Oct 1, 2022
1 parent f7dadd4 commit 09e8ab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
} from '@trpc/server'
import { createURL } from 'ufo'
import type { CompatibilityEvent } from 'h3'
import { defineEventHandler, isMethod, useBody } from 'h3'
import { defineEventHandler, isMethod, readBody } from 'h3'
import type { TRPCResponse } from '@trpc/server/dist/declarations/src/rpc'

type MaybePromise<T> = T | Promise<T>
Expand Down Expand Up @@ -63,7 +63,7 @@ export function createTRPCHandler<Router extends AnyRouter>({
req: {
method: req.method!,
headers: req.headers,
body: isMethod(event, 'GET') ? null : await useBody(event),
body: isMethod(event, 'GET') ? null : await readBody(event),
query: $url.searchParams,
},
path: $url.pathname.substring(endpoint.length + 1),
Expand Down

0 comments on commit 09e8ab5

Please sign in to comment.