generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORV2-2073 Adding allApplications query parameter (#1324)
- Loading branch information
1 parent
36763e2
commit 0fd58f3
Showing
4 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...src/modules/shopping-cart/dto/request/queryParam/getApplicationsInCart.query-param.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { Transform, Type } from 'class-transformer'; | ||
import { IsBoolean, IsOptional } from 'class-validator'; | ||
|
||
export class GetApplicationInCartQueryParams { | ||
@ApiPropertyOptional({ | ||
description: | ||
`If true, all applications in the company are retrieved; ` + | ||
`if false, only the current user's own applications are retrieved.` + | ||
`This field is only accepted for company administrators or staff;` + | ||
`Ignored otherwise.`, | ||
example: true, | ||
}) | ||
@Type(() => Boolean) | ||
@Transform(({ obj, key }: { obj: Record<string, unknown>; key: string }) => { | ||
if (obj[key] === 'true') return true; | ||
return obj[key] === 'false' ? false : obj[key]; | ||
}) | ||
@IsOptional() | ||
@IsBoolean() | ||
allApplications?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters