cars: default to most-common-in-NL order; dex numbers oldest first with unknown years last (--renumber)
All checks were successful
Deploy production / deploy (push) Successful in 2m41s

This commit is contained in:
2026-10-24 15:47:44 +00:00
parent 9e30e4246f
commit 45c124a365
4 changed files with 9 additions and 6 deletions

View File

@@ -24,8 +24,8 @@ export const BODIES = [
] as const;
export const DRIVES = ['fwd', 'rwd', 'awd', '4wd'] as const;
export const SORTS = {
dex: 'dex #',
popular: 'most common in NL',
dex: 'dex #',
name: 'name',
newest: 'newest',
oldest: 'oldest',

View File

@@ -38,7 +38,7 @@ export function parseFilters(params: URLSearchParams): CarFilters {
market: pick(params.get('market'), ['nl', 'us'] as const),
from: year(params.get('from')),
to: year(params.get('to')),
sort: sort && sort in SORTS ? (sort as CarSort) : 'dex',
sort: sort && sort in SORTS ? (sort as CarSort) : 'popular',
page: Math.min(Math.max(1, Math.floor(Number(params.get('page')) || 1)), 1000)
};
}

View File

@@ -50,7 +50,7 @@
}
const quick = [
{ label: '🔥 most common in NL', params: { sort: 'popular', market: 'nl' } },
{ label: '📖 dex order', params: { sort: 'dex' } },
{ label: '⚡ electric', params: { fuel: 'electric', sort: 'popular' } },
{ label: '🍃 hybrids', params: { fuel: 'hybrid', sort: 'popular' } },
{ label: '🏎️ coupés', params: { body: 'coupe', sort: 'popular' } },