Max limit of 10 for rahvatarkus archive API call

This commit is contained in:
Mihkel Martin Kasterpalu 2025-02-11 15:15:47 +02:00
parent 1674cdd726
commit f3ec1ff41d

View file

@ -5,7 +5,7 @@ import { eq, sql } from 'drizzle-orm';
import type { Question } from '$lib/types';
export async function GET({ params }) {
const limit = parseInt(params.limit) || 10;
const limit = Math.min(parseInt(params.limit) || 10, 10);
const offset = parseInt(params.offset) || 0;
// Get total count