From b9ebc33ca775c9e5b97d3185e4d9cd9fe16d0037 Mon Sep 17 00:00:00 2001 From: Johan Bisse Mattsson Date: Tue, 26 Nov 2024 10:54:16 +0100 Subject: [PATCH] Add artifical delay in test endpoint --- packages/supersearch/src/routes/api/find/+server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/supersearch/src/routes/api/find/+server.ts b/packages/supersearch/src/routes/api/find/+server.ts index e9af6949d..064d5d662 100644 --- a/packages/supersearch/src/routes/api/find/+server.ts +++ b/packages/supersearch/src/routes/api/find/+server.ts @@ -12,6 +12,8 @@ export const GET: RequestHandler = async ({ url }) => { const limit = parseInt(url.searchParams.get('_limit')!, 10); const offset = parseInt(url.searchParams.get('_offset') || '0', 10); + await new Promise((resolve) => setTimeout(resolve, 200)); + return json({ '@id': `/api/find?${url.searchParams.toString()}`, items: MOCK_ITEMS_DATA.slice(offset, offset + limit).map((item) => ({