Skip to content

Commit 7d81c6c

Browse files
author
Hasan Demir
committed
Fix style
1 parent e31755c commit 7d81c6c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

repositories/user.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ type UserRepository struct {
2828
// Create creates a user and returns the user.
2929
func (r *UserRepository) Create(dto *CreateUserDto) (*ent.User, error) {
3030
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)
3636
}
3737

3838
// FindByEmail finds a user by email and returns the user.
3939
func (r *UserRepository) FindByEmail(email string) (*ent.User, error) {
4040
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)
4444
}
4545

4646
// FindById finds a user by id and returns the user.
4747
func (r *UserRepository) FindByID(id int) (*ent.User, error) {
4848
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)
5252
}
5353

5454
func (r *UserRepository) ToInterfaceForJson(u *ent.User) interface{} {

0 commit comments

Comments
 (0)