refactor: use built-in getRequestURL from h3 instead of ufo

This commit is contained in:
wobsoriano
2023-08-20 21:41:57 -07:00
parent 3a395a7d4a
commit 252f6108cf
3 changed files with 24 additions and 33 deletions

View File

@@ -9,9 +9,8 @@ import type {
import {
TRPCError
} from '@trpc/server'
import { createURL } from 'ufo'
import type { H3Event } from 'h3'
import { createError, defineEventHandler, isMethod, readBody } from 'h3'
import { createError, defineEventHandler, getRequestURL, isMethod, readBody } from 'h3'
import type { TRPCResponse } from '@trpc/server/rpc'
type MaybePromise<T> = T | Promise<T>
@@ -74,7 +73,7 @@ export function createNuxtApiHandler<TRouter extends AnyRouter> ({
res
} = event.node
const $url = createURL(req.url!)
const $url = getRequestURL(event)
const path = getPath(event)