Implement database administration

Add routes and admin panel elements for creating a database backup,
restoring from a backup, deleting the existing schedule, and replacing
the database with the demo schedule.  These server as crude ways to
manage the data stored in the system.
This commit is contained in:
Hornwitser 2025-06-28 01:23:52 +02:00
parent b2f48e98e0
commit e5e923bc8d
6 changed files with 190 additions and 5 deletions

View file

@ -0,0 +1,11 @@
import { writeSchedule } from "~/server/database";
import type { ApiSchedule } from "~/shared/types/api";
export default defineEventHandler(async (event) => {
await requireServerSessionWithAdmin(event);
const schedule: ApiSchedule = {
id: 111,
updatedAt: new Date().toISOString(),
};
await writeSchedule(schedule);
})