mirror of
https://github.com/vercel/commerce.git
synced 2025-06-20 14:11:20 +00:00
18 lines
364 B
TypeScript
18 lines
364 B
TypeScript
import getSortVariables from './get-sort-variables'
|
|
import type { SearchProductsInput } from '../product/use-search'
|
|
|
|
export const getSearchVariables = ({
|
|
brandId,
|
|
search,
|
|
categoryId,
|
|
sort,
|
|
}: SearchProductsInput) => {
|
|
return {
|
|
categoryId,
|
|
filter: { search },
|
|
...getSortVariables(sort, !!categoryId),
|
|
}
|
|
}
|
|
|
|
export default getSearchVariables
|