mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
rename folder
This commit is contained in:
30
providers/saleor/utils/get-sort-variables.ts
Normal file
30
providers/saleor/utils/get-sort-variables.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
export const getSortVariables = (sort?: string, isCategory: boolean = false) => {
|
||||
let output = {}
|
||||
switch (sort) {
|
||||
case 'price-asc':
|
||||
output = {
|
||||
field: 'PRICE',
|
||||
direction: 'ASC',
|
||||
}
|
||||
break
|
||||
case 'price-desc':
|
||||
output = {
|
||||
field: 'PRICE',
|
||||
direction: 'DESC',
|
||||
}
|
||||
break
|
||||
case 'trending-desc':
|
||||
output = {
|
||||
field: 'RANK',
|
||||
direction: 'DESC',
|
||||
}
|
||||
break
|
||||
case 'latest-desc':
|
||||
output = {
|
||||
field: 'DATE',
|
||||
direction: 'DESC',
|
||||
}
|
||||
break
|
||||
}
|
||||
return output
|
||||
}
|
Reference in New Issue
Block a user