cars: car pokedex tracker (brands, models, US variants from RDW + fueleconomy.gov), import script, search/filter UI, model pages
Some checks failed
Deploy production / deploy (push) Has been cancelled
Some checks failed
Deploy production / deploy (push) Has been cancelled
This commit is contained in:
20
src/routes/trackers/cars/+page.server.ts
Normal file
20
src/routes/trackers/cars/+page.server.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { carOverview, PAGE_SIZE, parseFilters, searchCars } from '#lib/server/cars.js';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({ url }) => {
|
||||
const filters = parseFilters(url.searchParams);
|
||||
const [{ cars, total }, overview] = await Promise.all([searchCars(filters), carOverview()]);
|
||||
return {
|
||||
filters,
|
||||
cars,
|
||||
total,
|
||||
pageSize: PAGE_SIZE,
|
||||
brands: overview.brands,
|
||||
stats: overview.stats,
|
||||
currentYear: new Date().getFullYear(),
|
||||
seo: {
|
||||
title: 'Car pokedex',
|
||||
description: `Search ${overview.stats.models.toLocaleString('en-GB')} car models from ${overview.stats.brands} brands, with Dutch registration data and US fuel economy specs.`
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user