Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 0023810

Browse files
#267 - notify user when there are no results for company attribute filters
1 parent 0798c13 commit 0023810

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/src/components/SuggestionBox/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ export default function SuggestionBox({
105105
if (data.length < 1) data = [{ name: NO_RESULTS_FOUND }];
106106
setSuggestions(data);
107107
} else {
108-
const data = await getCompanyAttributesSuggestions(
108+
let data = await getCompanyAttributesSuggestions(
109109
apiClient,
110110
value,
111111
companyAttrId
112112
);
113+
if (data.length < 1) data = [{ name: NO_RESULTS_FOUND }];
113114
setSuggestions(data);
114115
}
115116
};
@@ -120,7 +121,8 @@ export default function SuggestionBox({
120121
if (purpose === "skills") {
121122
if (suggestion.name !== NO_RESULTS_FOUND) onSelect(suggestion);
122123
} else {
123-
onSelect(companyAttrId, suggestion);
124+
if (suggestion.name !== NO_RESULTS_FOUND)
125+
onSelect(companyAttrId, suggestion);
124126
}
125127
setValue("");
126128
};

0 commit comments

Comments
 (0)