Skip to content

Commit d9f90fc

Browse files
committed
Fix Filters
1 parent e8ad73f commit d9f90fc

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

src/cmd/filter.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,11 @@ EOF`,
100100
Args: cobra.ExactArgs(1),
101101
ArgAliases: []string{"ID"},
102102
Run: func(cmd *cobra.Command, args []string) {
103-
input, err := readResourceInput[opslevel.FilterCreateInput]()
103+
input, err := readResourceInput[opslevel.FilterUpdateInput]()
104104
cobra.CheckErr(err)
105+
input.Id = *opslevel.NewID(args[0])
105106

106-
// hack: in the future all ObjectUpdateInput and ObjectCreateInput
107-
// will be merged into ObjectInput. for now, create an update input
108-
// by adding in the first argument.
109-
updateInput := &opslevel.FilterUpdateInput{
110-
Id: *opslevel.NewID(args[0]),
111-
Name: opslevel.NewNullableFrom(input.Name),
112-
Predicates: input.Predicates,
113-
Connective: input.Connective,
114-
}
115-
filter, err := getClientGQL().UpdateFilter(*updateInput)
107+
filter, err := getClientGQL().UpdateFilter(*input)
116108
cobra.CheckErr(err)
117109
common.JsonPrint(json.MarshalIndent(filter, "", " "))
118110
},

0 commit comments

Comments
 (0)