fix: dont double cache documents

This commit is contained in:
2025-01-25 18:51:10 +01:00
parent 0f146ea699
commit 23f33b7472
6 changed files with 40 additions and 18 deletions

View File

@ -2,11 +2,14 @@ import { Handlers } from "$fresh/server.ts";
import { documentTable } from "@lib/db/schema.ts";
import { db } from "@lib/db/sqlite.ts";
import { json } from "@lib/helpers.ts";
import { caches } from "@lib/cache.ts";
export const handler: Handlers = {
async DELETE() {
for (const cache of caches.values()) {
cache.clear();
}
await db.delete(documentTable).run();
return json({ status: "ok" });
},
};

View File

@ -67,6 +67,7 @@ export default function Greet(
const portion = recipe.meta?.portion;
const amount = useSignal(portion || 1);
console.log({ recipe });
const subline = [
recipe?.meta?.time && `Duration ${recipe.meta.time}`,
@ -114,6 +115,7 @@ export default function Greet(
)
: (
<div
class="whitespace-break-spaces markdown-body"
dangerouslySetInnerHTML={{
__html: renderMarkdown(recipe?.markdown || ""),
}}