Skip to content

Commit

Permalink
fix: look for projects in organizations (#927)
Browse files Browse the repository at this point in the history
* fix: look for projects in organizations

* asd
  • Loading branch information
dbarrosop authored Dec 4, 2024
1 parent 6072b79 commit 21bef1c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
12 changes: 10 additions & 2 deletions clienv/wf_app_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@ func getRemoteAppInfo(
if err != nil {
return nil, fmt.Errorf("failed to get nhost client: %w", err)
}
workspaces, err := cl.GetOrganizationsAndWorkspacesApps(
resp, err := cl.GetOrganizationsAndWorkspacesApps(
ctx,
)
if err != nil {
return nil, fmt.Errorf("failed to get workspaces: %w", err)
}

for _, workspace := range workspaces.Workspaces {
for _, workspace := range resp.Workspaces {
for _, app := range workspace.Apps {
if app.Subdomain == subdomain {
return app, nil
}
}
}

for _, organization := range resp.Organizations {
for _, app := range organization.Apps {
if app.Subdomain == subdomain {
return app, nil
}
}
}

return nil, fmt.Errorf("failed to find app with subdomain: %s", subdomain) //nolint:goerr113
}

Expand Down
17 changes: 14 additions & 3 deletions nhostclient/graphql/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 21bef1c

Please sign in to comment.