mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-12-22 16:37:44 +00:00
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();
|
||||
|
||||
// Note: select first organization as organization switching not yet implemented
|
||||
const projects = res.organizations[0].projects;
|
||||
const orgName = res.organizations[0].name;
|
||||
const projects = res.organizations[0]?.projects || [];
|
||||
const orgName = res.organizations[0]?.name || '';
|
||||
|
||||
const updatedProjectsPromises = projects.map(async (project: any) => {
|
||||
const { deployments } = await client.getDeployments(String(project.id));
|
||||
|
Loading…
Reference in New Issue
Block a user