mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
rename folder
This commit is contained in:
18
providers/saleor/utils/get-search-variables.ts
Normal file
18
providers/saleor/utils/get-search-variables.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { getSortVariables } from './get-sort-variables'
|
||||
import type { SearchProductsInput } from '../product/use-search'
|
||||
|
||||
export const getSearchVariables = ({ brandId, search, categoryId, sort }: SearchProductsInput) => {
|
||||
const sortBy = {
|
||||
field: 'NAME',
|
||||
direction: 'ASC',
|
||||
...getSortVariables(sort, !!categoryId),
|
||||
channel: 'default-channel',
|
||||
}
|
||||
return {
|
||||
categoryId,
|
||||
filter: { search },
|
||||
sortBy,
|
||||
}
|
||||
}
|
||||
|
||||
export default getSearchVariables
|
Reference in New Issue
Block a user