From 9f7c42744fb04c84d578c55d7a39917bd9d5cdb2 Mon Sep 17 00:00:00 2001 From: Johaven Date: Mon, 22 Jul 2024 01:03:19 +0200 Subject: [PATCH 1/2] fix(platform-fastify): search method not declared --- packages/platform-fastify/adapters/fastify-adapter.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/platform-fastify/adapters/fastify-adapter.ts b/packages/platform-fastify/adapters/fastify-adapter.ts index 837eb09e0c5..6ad73561cfc 100644 --- a/packages/platform-fastify/adapters/fastify-adapter.ts +++ b/packages/platform-fastify/adapters/fastify-adapter.ts @@ -306,6 +306,10 @@ export class FastifyAdapter< return this.injectRouteOptions('options', ...args); } + public search(...args: any[]) { + return this.injectRouteOptions('search', ...args); + } + public applyVersionFilter( handler: Function, version: VersionValue, From 365fd1e5d8ce6cfdae7ce2cf7abec67aca88fc92 Mon Sep 17 00:00:00 2001 From: Johaven Date: Mon, 22 Jul 2024 01:18:59 +0200 Subject: [PATCH 2/2] fix: typing --- .../platform-fastify/adapters/fastify-adapter.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/platform-fastify/adapters/fastify-adapter.ts b/packages/platform-fastify/adapters/fastify-adapter.ts index 6ad73561cfc..218305ef72c 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'; @@ -672,17 +673,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) &&