Skip to content

Commit 52c01bf

Browse files
committed
fix decorator on 7 version of nestjs
1 parent a2eb99c commit 52c01bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pagination.decorator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createParamDecorator } from '@nestjs/common';
1+
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
22
import { ObjectLiteral } from 'typeorm';
33

44
export interface PaginationParams {
@@ -9,7 +9,8 @@ export interface PaginationParams {
99
_filter: ObjectLiteral;
1010
}
1111

12-
export const PgParams = createParamDecorator((data, req): PaginationParams => {
12+
export const PgParams = createParamDecorator((data: unknown, context: ExecutionContext): PaginationParams => {
13+
const req = context.switchToHttp().getRequest();
1314
const {
1415
_limit,
1516
_start,

0 commit comments

Comments
 (0)