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