-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: alias command to invite members #84
feat: alias command to invite members #84
Conversation
This pull request has been linked to Shortcut Story #235705: create alias command to invite members. |
"ldcli/internal/members" | ||
) | ||
|
||
const defaultRole = "reader" |
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.
we can also pass in an option --role
flag to override this if we want?
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.
That makes sense. It could be --role
/-r
.
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.
i'll add that in a follow up PR: https://app.shortcut.com/launchdarkly/story/238446/pass-in-option-role-r-flag-for-invite-members-command
if err != nil { | ||
return nil, errors.NewAPIError(err) | ||
} | ||
memberJson, err := json.Marshal(members.Items[0]) | ||
memberJson, err := json.Marshal(members.Items) |
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.
is it weird to return an array of members for the create
command? if so I can add additional logic here
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.
A little, yeah, but it's weird from our API, not here.
if err != nil { | ||
return nil, errors.NewAPIError(err) | ||
} | ||
memberJson, err := json.Marshal(members.Items[0]) | ||
memberJson, err := json.Marshal(members.Items) |
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.
A little, yeah, but it's weird from our API, not here.
"ldcli/internal/members" | ||
) | ||
|
||
const defaultRole = "reader" |
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.
That makes sense. It could be --role
/-r
.
Adds a new command to invite members using a list of emails passed in as a flag. Under the hood, this uses the same
Create
method that themembers create
command uses, which was refactored to take in a list of emails.OR