File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -28,27 +28,27 @@ type UserRepository struct {
28
28
// Create creates a user and returns the user.
29
29
func (r * UserRepository ) Create (dto * CreateUserDto ) (* ent.User , error ) {
30
30
return r .db .Client ().User .
31
- Create ().
32
- SetEmail (dto .Email ).
33
- SetPassword (r .Crypto .HashPassword (dto .Password )).
34
- SetName (dto .Name ).
35
- Save (r .ctx )
31
+ Create ().
32
+ SetEmail (dto .Email ).
33
+ SetPassword (r .Crypto .HashPassword (dto .Password )).
34
+ SetName (dto .Name ).
35
+ Save (r .ctx )
36
36
}
37
37
38
38
// FindByEmail finds a user by email and returns the user.
39
39
func (r * UserRepository ) FindByEmail (email string ) (* ent.User , error ) {
40
40
return r .db .Client ().User .
41
- Query ().
42
- Where (user .Email (email )).
43
- Only (r .ctx )
41
+ Query ().
42
+ Where (user .Email (email )).
43
+ Only (r .ctx )
44
44
}
45
45
46
46
// FindById finds a user by id and returns the user.
47
47
func (r * UserRepository ) FindByID (id int ) (* ent.User , error ) {
48
48
return r .db .Client ().User .
49
- Query ().
50
- Where (user .ID (id )).
51
- Only (r .ctx )
49
+ Query ().
50
+ Where (user .ID (id )).
51
+ Only (r .ctx )
52
52
}
53
53
54
54
func (r * UserRepository ) ToInterfaceForJson (u * ent.User ) interface {} {
You can’t perform that action at this time.
0 commit comments