Skip to content

Commit

Permalink
feat(vtex): recordsFiltered in suggestions loader (#727)
Browse files Browse the repository at this point in the history
Co-authored-by: guitavano <[email protected]>
  • Loading branch information
aka-sacci-ccr and guitavano authored Jul 23, 2024
1 parent 2203ebb commit 6564ec8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions commerce/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ export interface Search {
export interface Suggestion {
searches?: Search[];
products?: Product[];
hits?: number;
}

/** @titleBy url */
Expand Down
3 changes: 2 additions & 1 deletion vtex/loaders/intelligentSearch/suggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const loaders = async (
.then((res) => res.json());
};

const [{ searches }, { products }] = await Promise.all([
const [{ searches }, { products, recordsFiltered }] = await Promise.all([
query ? suggestions() : topSearches(),
productSearch(),
]);
Expand All @@ -88,6 +88,7 @@ const loaders = async (
withIsSimilarTo(req, ctx, p)
),
),
hits: recordsFiltered,
};
};

Expand Down

0 comments on commit 6564ec8

Please sign in to comment.