-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add grpc delete user implementation #190
Conversation
cmd/client/cmd/user.go
Outdated
@@ -84,6 +74,30 @@ func setPassword(cmd *cobra.Command, args []string) { | |||
fmt.Println("Password updated") | |||
} | |||
|
|||
func deleteUser(cmd *cobra.Command, args []string) { | |||
if userEmailFlag == "" { | |||
Usage(cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about cmd.Usage()
?
cmd/client/cmd/user.go
Outdated
cli := userpb.NewUserClient(conn) | ||
_, err = cli.Delete( | ||
context.Background(), | ||
&userpb.DeleteRequest{Email: userEmailFlag}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of create a new variable for this userEmailFlag
in /cmd/client.go
file ? (to avoid global / obscure / black magic variables)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, didn't recall our conversation about it.
Avoid globals and use cmd.Usage().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Also remove swagger delete user stuff.
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)