generated from phucvinh57/fastify-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from ngyngcphu/feat/add-search-filter-pagination
Feat/add search filter pagination
- Loading branch information
Showing
8 changed files
with
186 additions
and
63 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Static, Type } from '@sinclair/typebox'; | ||
|
||
export const UserModelQueryStringDto = Type.Object({ | ||
keyword: Type.Optional(Type.String({ description: 'The substring that the model name should contain' })), | ||
uploaded_after: Type.Optional( | ||
Type.String({ | ||
format: 'date-time', | ||
description: 'The time after which the model was uploaded, specified in ISO format', | ||
examples: ['2023-12-18'] | ||
}) | ||
), | ||
uploaded_before: Type.Optional( | ||
Type.String({ | ||
format: 'date-time', | ||
description: 'The time before which the model was uploaded, specified in ISO format', | ||
examples: ['2023-12-25'] | ||
}) | ||
), | ||
start: Type.Optional( | ||
Type.Number({ minimum: 0, multipleOf: 1, description: 'For pagination purpose - the index of the start item, starting at 0' }) | ||
), | ||
noItems: Type.Optional( | ||
Type.Number({ minimum: 1, multipleOf: 1, description: 'For pagination purpose - the number of items to return' }) | ||
), | ||
orderBy: Type.Optional( | ||
Type.Union([Type.Literal('uploadedTime'), Type.Literal('price'), Type.Literal('name')], { | ||
description: 'The name of the field to order on', | ||
examples: ['uploadedTime', 'price', 'name'] | ||
}) | ||
), | ||
order: Type.Optional( | ||
Type.Union([Type.Literal('asc'), Type.Literal('desc')], { description: 'Sort ascending or descending', examples: ['asc', 'desc'] }) | ||
) | ||
}); | ||
|
||
export type UserModelQueryStringDto = Static<typeof UserModelQueryStringDto>; |
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