forked from mirrors/homebox
cleanup return
This commit is contained in:
parent
194a90ccfb
commit
e159087e5f
1 changed files with 1 additions and 9 deletions
|
@ -28,18 +28,11 @@ func (e *EntUserRepository) GetOneEmail(ctx context.Context, email string) (*ent
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *EntUserRepository) GetAll(ctx context.Context) ([]*ent.User, error) {
|
func (e *EntUserRepository) GetAll(ctx context.Context) ([]*ent.User, error) {
|
||||||
users, err := e.db.User.Query().WithGroup().All(ctx)
|
return e.db.User.Query().WithGroup().All(ctx)
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return users, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *EntUserRepository) Create(ctx context.Context, usr types.UserCreate) (*ent.User, error) {
|
func (e *EntUserRepository) Create(ctx context.Context, usr types.UserCreate) (*ent.User, error) {
|
||||||
err := usr.Validate()
|
err := usr.Validate()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &ent.User{}, err
|
return &ent.User{}, err
|
||||||
}
|
}
|
||||||
|
@ -52,7 +45,6 @@ func (e *EntUserRepository) Create(ctx context.Context, usr types.UserCreate) (*
|
||||||
SetIsSuperuser(usr.IsSuperuser).
|
SetIsSuperuser(usr.IsSuperuser).
|
||||||
SetGroupID(usr.GroupID).
|
SetGroupID(usr.GroupID).
|
||||||
Save(ctx)
|
Save(ctx)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return entUser, err
|
return entUser, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue