Skip to content
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

Merged
merged 8 commits into from
Mar 28, 2024

Conversation

k3llymariee
Copy link
Contributor

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 the members create command uses, which was refactored to take in a list of emails.

go run main.go members invite -t {API_TOKEN} --baseUri http://localhost --emails test@email.com --emails email@test.com

OR

go run main.go members invite -t {API_TOKEN} --baseUri http://localhost --emails test@email.com,email@test.com

Copy link

This pull request has been linked to Shortcut Story #235705: create alias command to invite members.

"ldcli/internal/members"
)

const defaultRole = "reader"
Copy link
Contributor Author

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?

Copy link
Contributor

@dbolson dbolson Mar 28, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if err != nil {
return nil, errors.NewAPIError(err)
}
memberJson, err := json.Marshal(members.Items[0])
memberJson, err := json.Marshal(members.Items)
Copy link
Contributor Author

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

Copy link
Contributor

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.

@k3llymariee k3llymariee changed the title [feat] alias command to invite members feat: alias command to invite members Mar 27, 2024
@k3llymariee k3llymariee marked this pull request as ready for review March 27, 2024 22:55
if err != nil {
return nil, errors.NewAPIError(err)
}
memberJson, err := json.Marshal(members.Items[0])
memberJson, err := json.Marshal(members.Items)
Copy link
Contributor

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"
Copy link
Contributor

@dbolson dbolson Mar 28, 2024

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.

@k3llymariee k3llymariee merged commit 7002866 into main Mar 28, 2024
3 checks passed
@k3llymariee k3llymariee deleted the kelly/sc-235705/alias-command-to-invite-members branch March 28, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants