changes bootstrap mechanism
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { ms } from "$lib/meilisearch";
|
||||
import { error, json, type RequestEvent } from "@sveltejs/kit";
|
||||
|
||||
export async function POST(event: RequestEvent) {
|
||||
const data = await event.request.json()
|
||||
|
||||
try {
|
||||
const r = await ms.index(event.params.index as string).search(data.q, data.options);
|
||||
const r = await event.locals.ms.index(event.params.index as string).search(data.q, data.options);
|
||||
return json(r);
|
||||
} catch (e: any) {
|
||||
console.log(e);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { ms } from "$lib/meilisearch";
|
||||
import { error, json, type RequestEvent } from "@sveltejs/kit";
|
||||
|
||||
export async function POST(event: RequestEvent) {
|
||||
const data = await event.request.json()
|
||||
|
||||
try {
|
||||
const r = await ms.multiSearch({
|
||||
const r = await event.locals.ms.multiSearch({
|
||||
queries: data.queries
|
||||
});
|
||||
return json(r);
|
||||
|
||||
Reference in New Issue
Block a user