Skip to content

Commit

Permalink
feat: add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
giurigaud authored and ataideverton committed Oct 2, 2024
1 parent 97e325b commit 96644e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion node/resolvers/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ export const queries = {
// include SKU's availability and unit multiplier info in given seller
items = getSkuSellerInfo(simulationResults, result)
} else {
items = result.map((item: { sellers: any[] }) => ({
// ensures that each item in the result array has a sellers array that only includes sellers with a defined and non-null availability property.
// If no such sellers exist, the sellers array will be empty.
items = result.map((item: { sellers: any[] }) => ({
...item,
sellers: item.sellers?.filter((seller: any) =>
'availability' in seller &&
Expand Down

0 comments on commit 96644e3

Please sign in to comment.