Skip to content

Commit

Permalink
comment js
Browse files Browse the repository at this point in the history
  • Loading branch information
basher committed Apr 30, 2024
1 parent 5460792 commit 4fdad06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/src/javascript/web-components/webui-predictive-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default class WebUIPredictiveSearch extends HTMLElement {
return response.json();
})
.then((data) => {
// Results array contains matches to search query.
const results: [] = data.results.filter(
(result: { name: string | string[] }) =>
result.name.includes(query),
Expand All @@ -68,6 +69,7 @@ export default class WebUIPredictiveSearch extends HTMLElement {
return;
}

// Pass matching results to 'searchResults' template.
const resultTemplates = results.map(
(result: Record<string, string>) =>
searchResults(result),
Expand Down

0 comments on commit 4fdad06

Please sign in to comment.