Skip to content

Commit

Permalink
fix: minor stuff for overages (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
gris authored Sep 25, 2023
1 parent 77a1cc6 commit ba1d93c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions internal/cmd/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ var planShowCmd = &cobra.Command{
}

fmt.Printf("Organization: %s\n", internal.Emph(organizationName))
if currentOrg.Overages {
plan, _ = strings.CutSuffix(plan, "_overages")
}

fmt.Printf("Plan: %s\n", internal.Emph(plan))
fmt.Print(overagesMessage(currentOrg.Overages))
Expand Down Expand Up @@ -253,7 +256,11 @@ var planEnableOverages = &cobra.Command{
fmt.Println("Payment method added successfully.")
fmt.Printf("You can manage your payment methods with %s.\n\n", internal.Emph("turso org billing"))
}
return client.Organizations.SetOverages(org, true)
if err = client.Organizations.SetOverages(org, true); err != nil {
return err
}
fmt.Println("Overages enabled successfully.")
return nil
},
}

Expand All @@ -275,7 +282,11 @@ var planDisableOverages = &cobra.Command{
return err
}

return client.Organizations.SetOverages(org, false)
if err = client.Organizations.SetOverages(org, false); err != nil {
return err
}
fmt.Println("Overages disabled successfully.")
return nil
},
}

Expand Down

0 comments on commit ba1d93c

Please sign in to comment.