update cf on insights

This commit is contained in:
2025-12-18 00:20:02 -03:00
parent 3857620f89
commit 8081e838a3
10 changed files with 51 additions and 45 deletions

View File

@@ -1,9 +1,12 @@
import type { Route } from './+types/route'
import { createSearch } from '@repo/util/meili'
import { data } from 'react-router'
import { cloudflareContext } from '@repo/auth/context'
import { createSearch } from '@repo/util/meili'
export async function loader({ context, request }: Route.LoaderArgs) {
const cloudflare = context.get(cloudflareContext)
const { searchParams } = new URL(request.url)
const query = searchParams.get('q') || ''
const page = Number(searchParams.get('p')) + 1
@@ -16,7 +19,7 @@ export async function loader({ context, request }: Route.LoaderArgs) {
query,
page,
hitsPerPage,
env: context.cloudflare.env
env: cloudflare.env
})
return data(r)