Files
PolyMPR/routes/(apps)/admin/api/permissions.ts
T
djalim d3de5c29e7 refactor: add migration, seed permissions, update permissions API
feat(notes): add XLSX import island and admin route

feat(upload): add drag‑and‑drop upload, template download, UI tweaks
2026-04-27 17:08:58 +02:00

17 lines
575 B
TypeScript

import { FreshContext, Handlers } from "$fresh/server.ts";
import { db } from "$root/databases/db.ts";
import { permissions } from "$root/databases/schema.ts";
import { AuthenticatedState } from "$root/defaults/interfaces.ts";
export const handler: Handlers<null, AuthenticatedState> = {
async GET(
_request: Request,
_context: FreshContext<AuthenticatedState>,
): Promise<Response> {
const result = await db.select().from(permissions);
return new Response(JSON.stringify(result), {
headers: { "content-type": "application/json" },
});
},
};