-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update generators to use abstract paging logic
- Loading branch information
Showing
10 changed files
with
56 additions
and
81 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
7 changes: 2 additions & 5 deletions
7
...files/data-access/lib/dto/__adminFileName__-find-many-__modelFileName__.input.ts.template
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,11 +1,8 @@ | ||
import { Field, InputType, Int } from '@nestjs/graphql' | ||
import { PagingInput } from '@<%= npmScope %>/api/core/data-access' | ||
|
||
@InputType() | ||
export class <%= admin.className %>FindMany<%= model.className %>Input { | ||
export class <%= admin.className %>FindMany<%= model.className %>Input extends PagingInput() { | ||
@Field({ nullable: true }) | ||
search?: string | ||
@Field(() => Int, { nullable: true, defaultValue: 0 }) | ||
skip?: number | ||
@Field(() => Int, { nullable: true, defaultValue: 10 }) | ||
take?: number | ||
} |
6 changes: 6 additions & 0 deletions
6
...ools/src/lib/api/files/data-access/lib/entity/__modelFileName__-paging.entity.ts.template
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,6 @@ | ||
import { ObjectType } from '@nestjs/graphql' | ||
import { PagingResponse } from '@<%= npmScope %>/api/core/data-access' | ||
import { <%= model.className %> } from './<%= model.fileName %>.entity' | ||
|
||
@ObjectType() | ||
export class <%= model.className %>Paging extends PagingResponse<<%= model.className %>>(<%= model.className %>) {} |
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