Skip to content

Commit

Permalink
Merge pull request #13807 from johaven/fix-search-method
Browse files Browse the repository at this point in the history
fix(platform-fastify): search method not declared
  • Loading branch information
kamilmysliwiec authored Aug 12, 2024
2 parents dc9df54 + 365fd1e commit 0048313
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packages/platform-fastify/adapters/fastify-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
RequestGenericInterface,
RouteOptions,
RouteShorthandOptions,
HTTPMethods,
fastify,
} from 'fastify';
import * as Reply from 'fastify/lib/reply';
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) &&
Expand Down

0 comments on commit 0048313

Please sign in to comment.