Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Su <[email protected]>
  • Loading branch information
zhongnansu committed Mar 17, 2023
1 parent f29f3ac commit 0767a48
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/plugins/data/common/index_patterns/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ export const validateDataSourceReference = (
) => {
const references = indexPattern.references;
if (dataSourceId) {
return (
references[0] && references[0].id === dataSourceId && references[0].type === 'data-source'
);
return references.some((ref) => ref.id === dataSourceId && ref.type === 'data-source');
} else {
// No datasource id passed as input meaning we are getting index pattern from default cluster,
// and it's supposed to be an empty array
Expand Down

0 comments on commit 0767a48

Please sign in to comment.