File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
generators/with-mongo/templates/<%= compNameParamCasePlural %> Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1+ import pluralize from 'pluralize' ;
2+
13const ENTITY = '<%= compNameParamCase %>' ;
2- const RESOURCE = '<%= compNameParamCasePlural %>' ;
4+ const RESOURCE = pluralize ( ENTITY ) ;
35
46export { ENTITY , RESOURCE } ;
Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import {
33 Document as MongooseDocument ,
44 Model as MongooseModel ,
55} from 'mongoose' ;
6+ import pluralize from 'pluralize' ;
67
78import { < %= compNamePascalCase % > } from './types' ;
89import { ENTITY } from './constants' ;
910
1011interface Document extends MongooseDocument , Omit < < %= compNamePascalCase % > , 'id' > { }
1112interface Model extends MongooseModel < Document > { }
1213
13- const name = ENTITY ;
14+ const name = pluralize ( ENTITY ) ;
1415
1516const schema = new Schema < Document > ( {
1617 name : String ,
Original file line number Diff line number Diff line change 11interface < %= compNamePascalCase % > {
22 readonly id : string ;
3- readonly name : string ;
3+ readonly name ? : string ;
44 // TODO: add more props
55}
66
You can’t perform that action at this time.
0 commit comments