File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -438,22 +438,23 @@ export class CollectionService extends LoggerBase {
438438 insightsProjectId : string ,
439439 repositoryGroups : ICreateRepositoryGroup [ ] ,
440440 ) : Promise < IRepositoryGroup [ ] > {
441+ const rg = repositoryGroups || [ ]
441442 // Get existing repository groups for the given insights project
442443 const existingRepositoryGroups = await listRepositoryGroups ( qx , { insightsProjectId } )
443444
444445 // Extract IDs of existing repository groups
445446 const existingIds : string [ ] = existingRepositoryGroups . map ( ( rg ) => rg . id )
446447
447448 // Extract IDs of repository groups to be synchronized
448- const repositoryGroupIds : string [ ] = repositoryGroups . map ( ( rg ) => rg . id ) as string [ ]
449+ const repositoryGroupIds : string [ ] = rg . map ( ( rg ) => rg . id ) as string [ ]
449450
450451 // Find repository groups that need to be updated (exist in both lists)
451- const toUpdate : ICreateRepositoryGroup [ ] = repositoryGroups . filter ( ( rg ) =>
452+ const toUpdate : ICreateRepositoryGroup [ ] = rg . filter ( ( rg ) =>
452453 existingIds . includes ( rg . id ) ,
453454 )
454455
455456 // Find repository groups that need to be created (don't exist or have no ID)
456- const toCreate : ICreateRepositoryGroup [ ] = repositoryGroups . filter (
457+ const toCreate : ICreateRepositoryGroup [ ] = rg . filter (
457458 ( rg ) => ! rg . id || ! existingIds . includes ( rg . id ) ,
458459 )
459460
You can’t perform that action at this time.
0 commit comments