Skip to content

Commit

Permalink
make util make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Eilers committed Aug 18, 2023
1 parent 00c017e commit c577729
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions datahub-web-react/src/app/search/context/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getGroupedFieldName = (
): MatchedFieldName | undefined => {
const configs = getFieldConfigsByEntityType(entityType);
const fieldConfig = configs.find((config) => config.name === fieldName);
return fieldConfig?.groupInto || fieldConfig?.name;
return fieldConfig?.groupInto;
};

export const getMatchedFieldNames = (
Expand Down Expand Up @@ -77,8 +77,7 @@ const getMatchesGroupedByFieldName = (
const fieldNameToMatches = new Map<string, Array<MatchedField>>();
const fieldNames: Array<string> = [];
matchedFields.forEach((field) => {
const groupedFieldName = getGroupedFieldName(entityType, field.name);
if (!groupedFieldName) return;
const groupedFieldName = getGroupedFieldName(entityType, field.name) || field.name;
const matchesInMap = fieldNameToMatches.get(groupedFieldName);
if (matchesInMap) {
matchesInMap.push(field);
Expand Down

0 comments on commit c577729

Please sign in to comment.