forked from cerc-io/snowballtools-base
Handle if organizations is empty (#31)
Co-authored-by: neeraj <neeraj.rtly@gmail.com>
This commit is contained in:
parent
d4b0659307
commit
3829485672
@ -16,8 +16,8 @@ const ProjectSearch = () => {
|
|||||||
const res = await client.getOrganizations();
|
const res = await client.getOrganizations();
|
||||||
|
|
||||||
// Note: select first organization as organization switching not yet implemented
|
// Note: select first organization as organization switching not yet implemented
|
||||||
const projects = res.organizations[0].projects;
|
const projects = res.organizations[0]?.projects || [];
|
||||||
const orgName = res.organizations[0].name;
|
const orgName = res.organizations[0]?.name || '';
|
||||||
|
|
||||||
const updatedProjectsPromises = projects.map(async (project: any) => {
|
const updatedProjectsPromises = projects.map(async (project: any) => {
|
||||||
const { deployments } = await client.getDeployments(String(project.id));
|
const { deployments } = await client.getDeployments(String(project.id));
|
||||||
|
Loading…
Reference in New Issue
Block a user