Skip to content

Commit 6d9c1d3

Browse files
committed
feat: set optional entity
1 parent 547233a commit 6d9c1d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/common/decorators/paginated.decorator.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import { ToolsQueryDto } from '../dto/query/tools.query.dto';
55
import { QueryPipe } from '../pipes/query.pipe';
66
import { ApiDotNotationQuery } from './api-dot-notation-query.decorator';
77

8-
export const Paginated = (entity: any, entityDto: any) => {
8+
export const Paginated = (entityDto: any, entity?: any) => {
99
return applyDecorators(
1010
UsePipes(new QueryPipe()),
11-
ApiDotNotationQuery(ToolsQueryDto, PaginatedQueryDto, entity),
11+
entity
12+
? ApiDotNotationQuery(ToolsQueryDto, PaginatedQueryDto, entity)
13+
: ApiDotNotationQuery(ToolsQueryDto, PaginatedQueryDto),
1214
ApiResponse({ type: entityDto, isArray: true }),
1315
);
1416
};

0 commit comments

Comments
 (0)