From 5e2c466fbf0f091c9886067ea24b35c65f26f4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Gris?= Date: Mon, 25 Sep 2023 11:28:50 -0300 Subject: [PATCH] fix: minor stuff for overages --- 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 }, }