Skip to content

Commit

Permalink
Add artifical delay in test endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbissemattsson committed Nov 26, 2024
1 parent c8fd311 commit b9ebc33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/supersearch/src/routes/api/find/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down

0 comments on commit b9ebc33

Please sign in to comment.