diff --git a/packages/platform-fastify/adapters/fastify-adapter.ts b/packages/platform-fastify/adapters/fastify-adapter.ts index ae8d44648ec..6b99fa73d36 100644 --- a/packages/platform-fastify/adapters/fastify-adapter.ts +++ b/packages/platform-fastify/adapters/fastify-adapter.ts @@ -34,6 +34,7 @@ import { RequestGenericInterface, RouteOptions, RouteShorthandOptions, + HTTPMethods, fastify, } from 'fastify'; import * as Reply from 'fastify/lib/reply'; @@ -315,6 +316,10 @@ export class FastifyAdapter< return this.injectRouteOptions('options', ...args); } + public search(...args: any[]) { + return this.injectRouteOptions('search', ...args); + } + public applyVersionFilter( handler: Function, version: VersionValue, @@ -677,17 +682,7 @@ export class FastifyAdapter< return rawRequest.originalUrl || rawRequest.url; } - private injectRouteOptions( - routerMethodKey: - | 'get' - | 'post' - | 'put' - | 'delete' - | 'options' - | 'patch' - | 'head', - ...args: any[] - ) { + private injectRouteOptions(routerMethodKey: HTTPMethods, ...args: any[]) { const handlerRef = args[args.length - 1]; const isVersioned = !isUndefined(handlerRef.version) &&