Files
memorium/routes/api/cache.ts
2026-01-10 13:03:29 +01:00

16 lines
429 B
TypeScript

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";
import { define } from "../../utils.ts";
export const handler = define.handlers({
async DELETE() {
for (const cache of caches.values()) {
cache.clear();
}
await db.delete(documentTable).run();
return json({ status: "ok" });
},
});