From ba1d93c07d02cf60e581972d88585aa1392acedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Gris?= Date: Mon, 25 Sep 2023 11:44:41 -0300 Subject: [PATCH] fix: minor stuff for overages (#649) --- internal/cmd/plan.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/cmd/plan.go b/internal/cmd/plan.go index 0ec0d60b..88a1c5f8 100644 --- a/internal/cmd/plan.go +++ b/internal/cmd/plan.go @@ -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)) @@ -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 }, } @@ -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 }, }