From e159087e5f738f5e07b89431bfc3607064a2edc3 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 3 Sep 2022 19:17:56 -0800 Subject: [PATCH] cleanup return --- backend/internal/repo/repo_users.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/backend/internal/repo/repo_users.go b/backend/internal/repo/repo_users.go index 8fc348e..66cd7ac 100644 --- a/backend/internal/repo/repo_users.go +++ b/backend/internal/repo/repo_users.go @@ -28,18 +28,11 @@ func (e *EntUserRepository) GetOneEmail(ctx context.Context, email string) (*ent } func (e *EntUserRepository) GetAll(ctx context.Context) ([]*ent.User, error) { - users, err := e.db.User.Query().WithGroup().All(ctx) - - if err != nil { - return nil, err - } - - return users, nil + return e.db.User.Query().WithGroup().All(ctx) } func (e *EntUserRepository) Create(ctx context.Context, usr types.UserCreate) (*ent.User, error) { err := usr.Validate() - if err != nil { return &ent.User{}, err } @@ -52,7 +45,6 @@ func (e *EntUserRepository) Create(ctx context.Context, usr types.UserCreate) (* SetIsSuperuser(usr.IsSuperuser). SetGroupID(usr.GroupID). Save(ctx) - if err != nil { return entUser, err }