Skip to content

Commit

Permalink
Merge pull request #189 from huhaiqwer/master
Browse files Browse the repository at this point in the history
Update user.go
  • Loading branch information
elenz97 authored Jun 19, 2024
2 parents 6734fd4 + f9a8454 commit 4ef80a2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apiv2/pkg/clients/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func (c *RESTClient) GetUserByID(ctx context.Context, id int64) (*model.UserResp
params.WithTimeout(c.Options.Timeout)

resp, err := c.V2Client.User.GetUser(params, c.AuthInfo)


if err != nil {
return nil, handleSwaggerUserErrors(err)
}

if resp.Payload == nil {
return nil, &clienterrors.ErrUserNotFound{}
}
Expand All @@ -120,9 +124,6 @@ func (c *RESTClient) GetUserByID(ctx context.Context, id int64) (*model.UserResp
return nil, &clienterrors.ErrUserInvalidID{}
}

if err != nil {
return nil, handleSwaggerUserErrors(err)
}

return resp.Payload, nil
}
Expand Down

0 comments on commit 4ef80a2

Please sign in to comment.