@@ -189,6 +189,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
||||
if flagDescription != "" {
|
||||
input["description"] = flagDescription
|
||||
}
|
||||
|
||||
if flagWebsite != "" {
|
||||
input["websiteUrl"] = flagWebsite
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
var confirmed bool
|
||||
|
||||
err := huh.NewConfirm().
|
||||
Title(fmt.Sprintf("Delete reference %s?", args[0])).
|
||||
Value(&confirmed).
|
||||
@@ -52,6 +53,7 @@ func NewCmdDelete(f *cmdutil.Factory) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !confirmed {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if err := cmdutil.ValidateEnum("order-by", flagOrderBy, []string{"RANK", "NAME", "CREATED_AT", "UPDATED_AT"}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
variables["orderBy"] = map[string]any{
|
||||
"field": flagOrderBy,
|
||||
"direction": flagOrderDir,
|
||||
@@ -142,15 +143,19 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if err := json.Unmarshal(data, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if resp.Node == nil {
|
||||
return nil, fmt.Errorf("organization %s not found", flagOrg)
|
||||
}
|
||||
|
||||
if resp.Node.Typename != "Organization" {
|
||||
return nil, fmt.Errorf("expected Organization node, got %s", resp.Node.Typename)
|
||||
}
|
||||
|
||||
if resp.Node.TrustCenter == nil {
|
||||
return nil, fmt.Errorf("trust center not found for organization %s", flagOrg)
|
||||
}
|
||||
|
||||
return &resp.Node.TrustCenter.References, nil
|
||||
},
|
||||
)
|
||||
@@ -173,6 +178,7 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
|
||||
if r.WebsiteUrl != nil {
|
||||
website = *r.WebsiteUrl
|
||||
}
|
||||
|
||||
rows = append(rows, []string{
|
||||
r.ID,
|
||||
r.Name,
|
||||
|
||||
Reference in New Issue
Block a user