feat: some shit

This commit is contained in:
2023-08-07 13:42:00 +02:00
parent aff3019768
commit 990db3ae50
8 changed files with 36 additions and 25 deletions

View File

@ -43,8 +43,6 @@ async function updateMovieMetadata(
return root;
});
console.log({ newDoc });
return createDocument(docId, newDoc);
}

View File

@ -2,10 +2,7 @@ import { Handlers } from "$fresh/server.ts";
import { BadRequestError } from "@lib/errors.ts";
import { getTypeSenseClient } from "@lib/typesense.ts";
import { json } from "@lib/helpers.ts";
import { getArticle } from "@lib/resource/articles.ts";
import { getMovie } from "@lib/tmdb.ts";
import { getRecipe } from "@lib/resource/recipes.ts";
import { getDocument } from "@lib/documents.ts";
import { extractHashTags } from "@lib/string.ts";
export const handler: Handlers = {
async GET(req, _ctx) {
@ -23,6 +20,11 @@ export const handler: Handlers = {
filter_by = `type:=${type}`;
}
const hashTags = extractHashTags(query);
if (hashTags?.length) {
//filter_by += `tags:=${}`
}
const typesenseClient = await getTypeSenseClient();
if (!typesenseClient) {
throw new Error("Query not available");