Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(platform-fastify): search method not declared #13807

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -306,6 +307,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 @@ -668,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) &&
Expand Down
Loading