diff --git a/nuxt.config.ts b/nuxt.config.ts index 2615408..ab6d26b 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -26,6 +26,7 @@ export default defineNuxtConfig({ aiModel: '@cf/meta/llama-3.1-8b-instruct', aiPrompt: `You are a URL shortening assistant, please shorten the URL provided by the user into a SLUG. The SLUG information must come from the URL itself, do not make any assumptions. A SLUG is human-readable and should not exceed three words and can be validated using regular expressions {slugRegex} . Only the best one is returned, the format must be JSON reference {"slug": "example-slug"}`, caseSensitive: false, + listQueryLimit: 500, public: { previewMode: '', slugDefaultLength: '6', diff --git a/schemas/query.ts b/schemas/query.ts index dceadc1..fae9258 100644 --- a/schemas/query.ts +++ b/schemas/query.ts @@ -1,5 +1,7 @@ import { z } from 'zod' +const listQueryLimit = +useRuntimeConfig().listQueryLimit + export const QuerySchema = z.object({ id: z.string().optional(), startAt: z.coerce.number().int().safe().optional(), @@ -17,7 +19,7 @@ export const QuerySchema = z.object({ browserType: z.string().optional(), device: z.string().optional(), deviceType: z.string().optional(), - limit: z.coerce.number().int().safe().default(500), + limit: z.coerce.number().int().safe().default(listQueryLimit), }) export const FilterSchema = QuerySchema.omit({ id: true, startAt: true, endAt: true, limit: true }).extend({