-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): search workflows by name or trigger identifier
- Loading branch information
Showing
13 changed files
with
201 additions
and
19 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
33 changes: 33 additions & 0 deletions
33
apps/api/src/app/shared/dtos/pagination-with-filters-request.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,33 @@ | ||
import { ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { IsOptional, IsString } from 'class-validator'; | ||
|
||
import { Constructor } from '../types'; | ||
import { IPagination, PaginationRequestDto } from './pagination-request'; | ||
|
||
export interface IPaginationWithFilters extends IPagination { | ||
query?: string; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export function PaginationWithFiltersRequestDto({ | ||
defaultLimit = 10, | ||
maxLimit = 100, | ||
queryDescription, | ||
}: { | ||
defaultLimit: number; | ||
maxLimit: number; | ||
queryDescription: string; | ||
}): Constructor<IPaginationWithFilters> { | ||
class PaginationWithFiltersRequest extends PaginationRequestDto(defaultLimit, maxLimit) { | ||
@ApiPropertyOptional({ | ||
type: String, | ||
required: false, | ||
description: `A query string to filter the results. ${queryDescription}`, | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
query?: string; | ||
} | ||
|
||
return PaginationWithFiltersRequest; | ||
} |
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 @@ | ||
export type Constructor<I> = new (...args: any[]) => I; |
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
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import { PaginationRequestDto } from '../../shared/dtos/pagination-request'; | ||
import { PaginationWithFiltersRequestDto } from '../../shared/dtos/pagination-with-filters-request'; | ||
|
||
export class WorkflowsRequestDto extends PaginationRequestDto(10, 100) {} | ||
export class WorkflowsRequestDto extends PaginationWithFiltersRequestDto({ | ||
defaultLimit: 10, | ||
maxLimit: 100, | ||
queryDescription: 'It allows filtering based on either the name or trigger identifier of the workflow items.', | ||
}) {} |
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
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
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
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