owltide/server/api/admin/delete-schedule.post.ts
Hornwitser e5e923bc8d 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.
2025-06-28 01:30:39 +02:00

11 lines
327 B
TypeScript

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);
})