Skip to content

Commit

Permalink
Merge pull request #92 from souravbhowmik1999/searchCohortApiChanges
Browse files Browse the repository at this point in the history
TypeORMError: Provided take value is not a number. Please provide a n…
  • Loading branch information
vijaykhollam authored Apr 3, 2024
2 parents 7b8db7d + e71a9b5 commit eabb044
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cohort/cohort.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {
Headers,
Delete,
UseGuards,
ValidationPipe,
UsePipes,
} from "@nestjs/common";
import { CohortSearchDto } from "./dto/cohort-search.dto";
import { Request } from "@nestjs/common";
Expand Down Expand Up @@ -133,6 +135,7 @@ export class CohortController {
@ApiBody({ type: CohortSearchDto })
@ApiForbiddenResponse({ description: "Forbidden" })
@UseInterceptors(ClassSerializerInterceptor)
@UsePipes(ValidationPipe)
@SerializeOptions({
strategy: "excludeAll",
})
Expand Down
3 changes: 3 additions & 0 deletions src/cohort/dto/cohort-search.dto.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsNumberString } from "class-validator";


export class CohortSearchDto {
@ApiProperty({
type: String,
description: "Limit",
})
@IsNumberString()
limit: string;

@ApiProperty({
Expand Down

0 comments on commit eabb044

Please sign in to comment.