File tree Expand file tree Collapse file tree 3 files changed +9
-16
lines changed Expand file tree Collapse file tree 3 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,6 @@ export class User extends Base implements DatabaseUser {
28
28
@OneToMany ( ( ) => Session , "user" )
29
29
sessions = new Collection < Session , this> ( this )
30
30
31
- @Embedded ( ( ) => Address , { object : true } )
32
- address ! : Address
31
+ @Embedded ( ( ) => Address , { object : true , nullable : true } )
32
+ address ? : Address
33
33
}
Original file line number Diff line number Diff line change @@ -35,14 +35,7 @@ export function createRandomUsersUtils(orm: MikroORM): RandomUserUtils {
35
35
const name = [ firstName , lastName ] . join ( " " )
36
36
const email = faker . internet . email ( { firstName, lastName} )
37
37
38
- return {
39
- email,
40
- name,
41
- address : {
42
- street : faker . location . streetAddress ( ) ,
43
- city : faker . location . city ( )
44
- }
45
- }
38
+ return { email, name}
46
39
}
47
40
48
41
const createMany : CreateManyUsers = ( amount , cb ) =>
Original file line number Diff line number Diff line change 1
- export interface UserInput {
2
- email : string
3
- name : string
4
- address : AddressInput
5
- }
6
-
7
1
export interface AddressInput {
8
2
street : string
9
3
city : string
10
4
}
11
5
6
+ export interface UserInput {
7
+ email : string
8
+ name : string
9
+ address ?: AddressInput
10
+ }
11
+
12
12
export interface SessionInput {
13
13
token : string
14
14
userId : string
You can’t perform that action at this time.
0 commit comments