Skip to content

Commit

Permalink
fix: Fix PLP previous button behaviour (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
soniaklimas authored Jan 27, 2025
1 parent b1002c3 commit 14ecaf2
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ export const saleorSearchInfra =
},
context,
) => {
// Last and first cannot be combined in the same query
const pageInfo = before
? { before, last: limit }
? { before, last: limit, first: undefined }
: after
? { after, first: limit }
: { first: limit };
? { after, first: limit, last: undefined }
: { first: limit, last: undefined };
// TODO: Find a better way how to handle filters between providers
const attributesFilter: AttributeInput[] | undefined = filters
? Object.entries(filters).map(([slug, value]) => ({
Expand Down Expand Up @@ -61,9 +62,7 @@ export const saleorSearchInfra =
filter: {
attributes: attributesFilter,
},
first: limit,
languageCode: context.languageCode as LanguageCodeEnum,
last: null,
search: query,
searchByCategory: Boolean(category),
searchByCollection: Boolean(collection),
Expand Down

0 comments on commit 14ecaf2

Please sign in to comment.