mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 02:53:50 +00:00
refactor(#65): add types to products page params
This commit is contained in:
@@ -3,11 +3,11 @@ import { getActiveProductsWithPrices } from '$lib/utils/supabase/admin';
|
||||
import logger from '$lib/utils/logger/logger';
|
||||
|
||||
export const GET = async ({ url }) => {
|
||||
const limitParam = url.searchParams.get('limit');
|
||||
const offsetParam = url.searchParams.get('offset');
|
||||
const limitParam: string | null = url.searchParams.get('limit');
|
||||
const offsetParam: string | null = url.searchParams.get('offset');
|
||||
try {
|
||||
const limit = limitParam ? parseInt(limitParam, 10) : 10;
|
||||
const offset = offsetParam ? parseInt(offsetParam, 10) : 0;
|
||||
const limit = limitParam ? Number.parseInt(limitParam, 10) : 10;
|
||||
const offset = offsetParam ? Number.parseInt(offsetParam, 10) : 0;
|
||||
|
||||
const { products, count } = await getActiveProductsWithPrices(limit, offset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user