@lenne.tech/cli 0.0.72 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Restricted, RoleEnum } from '@lenne.tech/nest-server';
|
|
1
|
+
import { mapClasses, Restricted, RoleEnum } from '@lenne.tech/nest-server';
|
|
2
2
|
import { Field, ObjectType } from '@nestjs/graphql';
|
|
3
3
|
import { Prop, Schema as MongooseSchema, SchemaFactory } from '@nestjs/mongoose';
|
|
4
4
|
import { Document, Schema } from 'mongoose';
|
|
@@ -48,6 +48,16 @@ export class <%= props.namePascal %> extends PersistenceModel {
|
|
|
48
48
|
this.properties = [];
|
|
49
49
|
return this;
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Map input
|
|
54
|
+
*
|
|
55
|
+
* Hint: Non-primitive variables should always be mapped (see mapClasses / mapClassesAsync in ModelHelper)
|
|
56
|
+
*/
|
|
57
|
+
map(input) {
|
|
58
|
+
super.map(input);
|
|
59
|
+
return mapClasses(input, {user: User}, this);
|
|
60
|
+
}
|
|
51
61
|
}
|
|
52
62
|
|
|
53
63
|
export const <%= props.namePascal %>Schema = SchemaFactory.createForClass(<%= props.namePascal %>);
|