fix: dont double cache documents
This commit is contained in:
@ -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" });
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -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 || ""),
|
||||
}}
|
||||
|
Reference in New Issue
Block a user