Skip to content
Discussion options

You must be logged in to vote

You could use this for your query object:

query: {
  ...(filteredArray.length && {l: filteredArray}),
  ...(departmentFilters.length && {d: departmentFilters}),
  ...(keyword && {q: keyword})
},

that will conditionally add the filter properties to the query object

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@prafulrajhm
Comment options

Answer selected by prafulrajhm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants