Skip to content

Commit 1c40d49

Browse files
chore: enforce uuid for workspaceid in policy delete
1 parent 360ab4b commit 1c40d49

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cmd/ctrlc/root/api/delete/policy/policy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/MakeNowJust/heredoc/v2"
77
"github.com/ctrlplanedev/cli/internal/api"
88
"github.com/ctrlplanedev/cli/internal/cliutil"
9+
"github.com/google/uuid"
910
"github.com/spf13/cobra"
1011
"github.com/spf13/viper"
1112
)
@@ -43,7 +44,7 @@ func NewDeletePolicyCmd() *cobra.Command {
4344
return fmt.Errorf("policy ID is not yet supported")
4445
}
4546

46-
resp, err := client.DeletePolicyByName(cmd.Context(), workspace, name)
47+
resp, err := client.DeletePolicyByName(cmd.Context(), uuid.MustParse(workspace), name)
4748
if err != nil {
4849
return fmt.Errorf("failed to delete policy: %w", err)
4950
}

internal/api/client.gen.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)