55 "errors"
66 "fmt"
77 "net/http"
8+ "strconv"
89
910 "github.com/MakeNowJust/heredoc"
1011 "github.com/loginradius/lr-cli/api"
@@ -77,13 +78,13 @@ func addSite() error {
7778
7879func input () bool {
7980 fmt .Printf ("Enter the App Name: " )
80- fmt .Scanf ("%s" , & AppName )
81+ fmt .Scanf ("%s\n " , & AppName )
8182 if AppName == "" {
8283 fmt .Println ("App Name is a required entry" )
8384 return false
8485 }
8586 fmt .Printf ("Enter the Domain: " )
86- fmt .Scanf ("%s" , & Domain )
87+ fmt .Scanf ("%s\n " , & Domain )
8788 if Domain == "" {
8889 fmt .Println ("Domain is a required entry" )
8990 return false
@@ -93,12 +94,12 @@ func input() bool {
9394 "2" : "developer" ,
9495 "3" : "business" ,
9596 }
96- fmt .Println ("To select a plan, choose a correponding number from the following options: " )
97+ fmt .Println ("To select a plan, choose a corresponding number from the following options: " )
9798 fmt .Println ("1 - Free plan" )
9899 fmt .Println ("2 - Developer plan" )
99100 fmt .Println ("3 - Developer Pro plan" )
100101 fmt .Printf ("Option: " )
101- fmt .Scanf ("%s" , & planOption )
102+ fmt .Scanf ("%s\n " , & planOption )
102103 if planOption == "" {
103104 fmt .Println ("Plan is a required entry" )
104105 return false
@@ -153,10 +154,16 @@ func add() error {
153154 if err != nil {
154155 return err
155156 }
157+ appInfo , err := api .GetAppsInfo ()
158+ if err != nil {
159+ return err
160+ }
161+ appCount := len (appInfo )
156162 newApp := conf .AdminConsoleAPIDomain + "/auth/create-new-app?"
157163 body , _ := json .Marshal (map [string ]string {
158164 "appName" : AppName ,
159165 "domain" : Domain ,
166+ "ownedAppCount" : strconv .Itoa (appCount ),
160167 "paymentMethodId" : paymentInfo .Data .Order [0 ].Paymentdetail .Stripepaymentmethodid ,
161168 "planName" : PlanName ,
162169 })
0 commit comments