mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 12:11:22 +00:00
Sort products by available_on when using the Trending sorting in useSearch
This commit is contained in:
parent
0540258522
commit
57c176d9d7
@ -7,7 +7,7 @@ import type { GraphQLFetcherResult } from '@commerce/api'
|
|||||||
import { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product'
|
import { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product'
|
||||||
|
|
||||||
const nextToSpreeSortMap: { [key: string]: string } = {
|
const nextToSpreeSortMap: { [key: string]: string } = {
|
||||||
'trending-desc': 'updated_at', // FIXME: Spree has no "trending" filter. Using updated_at.
|
'trending-desc': 'available_on',
|
||||||
'latest-desc': 'updated_at',
|
'latest-desc': 'updated_at',
|
||||||
'price-asc': 'price',
|
'price-asc': 'price',
|
||||||
'price-desc': '-price',
|
'price-desc': '-price',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user