16 lines
429 B
TypeScript
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" });
|
|
},
|
|
});
|