-
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.
feat: treat unique values on mock (#322)
* feat: treat unique values on mock * fix: fix index.ts nestjs-models-rest * fix: generating mock function always return an array of object * fix: update import wording * fix: finish merge (forgot some merge) * fix: update test after bad merge Co-authored-by: Killian Challeau <killian@tractr.net> Co-authored-by: floross <floross@users.noreply.github.com>
- Loading branch information
1 parent
078c93a
commit 8437c86
Showing
16 changed files
with
384 additions
and
104 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
16 changes: 16 additions & 0 deletions
16
libs/hapify/templates/models/hapify/generated/models/models/__kebab__.dto.ts.hpf
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,16 @@ | ||
<<if Fields unique>> | ||
export type <<Model pascal>>UniqueValues = { | ||
<<for Fields unique field>> | ||
<<if field not entity>> | ||
<<field camel>>: <<=getType(field)>>[], | ||
<<else>> | ||
<<field camel>>Id: string[]; | ||
<<endif>> | ||
<<endfor>> | ||
}; | ||
<<endif>> | ||
<<< | ||
function getType(f) { | ||
return f.type; | ||
} | ||
>>> |
Binary file removed
BIN
-7.71 KB
.../models/hapify/generated/models/models/adf1bbca-4d99-46a3-b705-8059d34c04ba.jpg
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
libs/hapify/templates/models/hapify/generated/models/models/index.ts.hpf
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,6 @@ | ||
<<for Models model>> | ||
export * from './<<model kebab>>'; | ||
<<if model.properties.hasUnique>> | ||
export * from './<<model kebab>>.dto'; | ||
<<endif>> | ||
<<endfor>> |
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
Oops, something went wrong.