Skip to content

Commit

Permalink
change: remove error from queries with no results (#43)
Browse files Browse the repository at this point in the history
* Removed return err if no environments found

* Updated remaining cmds
  • Loading branch information
CGoodwin90 authored Feb 29, 2024
1 parent 5ffb709 commit b9f0c2c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
4 changes: 0 additions & 4 deletions api/lagoon/client/deploytargets.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package client
import (
"context"
"encoding/json"
"fmt"
"github.com/machinebox/graphql"
"github.com/uselagoon/machinery/api/schema"
)
Expand Down Expand Up @@ -97,9 +96,6 @@ func (c *Client) DeployTargetsByOrganizationNameOrID(ctx context.Context, name *
}
}

if len(o.DeployTargets) == 0 {
return fmt.Errorf("no deploy targets found for organization %s", o.Name)
}
data, err := json.Marshal(o.DeployTargets)
if err != nil {
return err
Expand Down
5 changes: 0 additions & 5 deletions api/lagoon/client/environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package client
import (
"context"
"encoding/json"
"fmt"

"github.com/uselagoon/machinery/api/schema"
)

Expand Down Expand Up @@ -116,9 +114,6 @@ func (c *Client) EnvironmentsByProjectName(ctx context.Context, project string,
if err != nil {
return err
}
if len(p.Environments) == 0 {
return fmt.Errorf("no environments found for project")
}
db, err := json.Marshal(p.Environments)
if err != nil {
return err
Expand Down
5 changes: 0 additions & 5 deletions api/lagoon/client/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package client
import (
"context"
"encoding/json"
"fmt"

"github.com/uselagoon/machinery/api/schema"
)

Expand Down Expand Up @@ -224,9 +222,6 @@ func (c *Client) ProjectsByOrganizationID(ctx context.Context, id uint, projects
if err != nil {
return err
}
if len(o.Projects) == 0 {
return fmt.Errorf("no associated projects found for organization %s", o.Name)
}
data, err := json.Marshal(o.Projects)
if err != nil {
return err
Expand Down
5 changes: 0 additions & 5 deletions api/lagoon/client/usergroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package client
import (
"context"
"encoding/json"
"fmt"

"github.com/uselagoon/machinery/api/schema"
)

Expand Down Expand Up @@ -309,9 +307,6 @@ func (c *Client) GroupsByOrganizationID(ctx context.Context, id uint, groups *[]
if err != nil {
return err
}
if len(o.Groups) == 0 {
return fmt.Errorf("no associated groups found for organization %s", o.Name)
}
data, err := json.Marshal(o.Groups)
if err != nil {
return err
Expand Down

0 comments on commit b9f0c2c

Please sign in to comment.