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

small fixes to /jira instance delete #52

Merged
merged 1 commit into from
May 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions server/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ func executeInstanceDelete(p *Plugin, c *plugin.Context, header *model.CommandAr
if err != nil {
return responsef("Failed to load known JIRA instances: %v", err)
}
if len(known) == 0 {
return responsef("There are no instances to delete.\n")
}

num, err := strconv.ParseUint(instanceKey, 10, 8)
if err == nil {
Expand All @@ -245,6 +248,10 @@ func executeInstanceDelete(p *Plugin, c *plugin.Context, header *model.CommandAr
return responsef("failed to delete Jira instance %s: %v", instanceKey, err)
}

// if that was our only instance, just respond with an empty list.
if len(known) == 1 {
return executeInstanceList(p, c, header)
}
return executeInstanceSelect(p, c, header, "1")
}

Expand Down