share route itens
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Route } from './+types'
|
||||
import type { Route } from './+types/route'
|
||||
|
||||
import { Suspense } from 'react'
|
||||
import { Await } from 'react-router'
|
||||
@@ -16,12 +16,13 @@ export function meta({}: Route.MetaArgs) {
|
||||
export async function loader({ context, request }: Route.LoaderArgs) {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const page = Number(searchParams.get('p')) + 1
|
||||
const sort = searchParams.get('sort') || 'create_date:desc'
|
||||
const hitsPerPage = Number(searchParams.get('perPage')) || 25
|
||||
|
||||
return {
|
||||
data: createSearch({
|
||||
index: 'betaeducacao-prod-orders',
|
||||
sort: ['create_date:desc'],
|
||||
sort: [sort],
|
||||
page,
|
||||
hitsPerPage,
|
||||
env: context.cloudflare.env
|
||||
|
||||
Reference in New Issue
Block a user