Skip to content

Commit

Permalink
SCALRCORE-23827 Fix naming of id filter params [API_BRANCH]
Browse files Browse the repository at this point in the history
  • Loading branch information
denkl committed Apr 3, 2023
1 parent 21e1415 commit 2e9dae9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type VariableListOptions struct {

type VariableFilter struct {
// Filter by ID
ID *string `url:"var,omitempty"`
Var *string `url:"var,omitempty"`

// Filter by key
Key *string `url:"key,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func TestVariablesList(t *testing.T) {

responseVariables, err := client.Variables.List(
ctx, VariableListOptions{Filter: &VariableFilter{
ID: String(fooVariable.ID),
Var: String(fooVariable.ID),
}},
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ type WorkspacePermissions struct {
type WorkspaceListOptions struct {
ListOptions

ID *string `url:"filter[workspace],omitempty"`
Workspace *string `url:"filter[workspace],omitempty"`
Environment *string `url:"filter[environment],omitempty"`
AgentPool *string `url:"filter[agent-pool],omitempty"`
Name *string `url:"filter[name],omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestWorkspacesList(t *testing.T) {
t.Run("with ID in list options", func(t *testing.T) {
wsl, err := client.Workspaces.List(ctx, WorkspaceListOptions{
Environment: &envTest.ID,
ID: &wsTest1.ID,
Workspace: &wsTest1.ID,
})
require.NoError(t, err)
assert.Equal(t, 1, wsl.TotalCount)
Expand Down

0 comments on commit 2e9dae9

Please sign in to comment.