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" });
},
};