Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: deleting user
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Jun 1, 2021
1 parent 2d08c50 commit f531bd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/usecase/interactor/user.go
Expand Up @@ -288,7 +288,7 @@ func (i *User) SearchUser(ctx context.Context, nameOrEmail string, operator *use
}

func (i *User) DeleteMe(ctx context.Context, userID id.UserID, operator *usecase.Operator) (err error) {
if operator == nil || operator.User.IsNil() || userID.IsNil() || userID != operator.User {
if userID.IsNil() || operator != nil && !operator.User.IsNil() && userID != operator.User {
return errors.New("invalid user id")
}

Expand Down

0 comments on commit f531bd0

Please sign in to comment.