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" });
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user