diff --git a/components/EventsEdit.vue b/components/EventsEdit.vue
deleted file mode 100644
index 3dbd699..0000000
--- a/components/EventsEdit.vue
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
- Admin Edit
- Create Event
-
- Edit Event
-
-
-
-
-
-
-
diff --git a/pages/schedule.vue b/pages/schedule.vue
index 9ae73fc..60ac4b5 100644
--- a/pages/schedule.vue
+++ b/pages/schedule.vue
@@ -41,7 +41,6 @@
-
Events
Locations
diff --git a/server/api/create-event.post.ts b/server/api/create-event.post.ts
deleted file mode 100644
index 04b3d06..0000000
--- a/server/api/create-event.post.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Schedule } from "~/shared/types/schedule";
-import { broadcastUpdate } from "~/server/streams";
-import { sendPush } from "~/server/web-push";
-import { readSchedule, writeSchedule } from "~/server/database";
-
-export default defineEventHandler(async (event) => {
- const formData = await readFormData(event);
- const schedule: Schedule = await readSchedule();
- const id = formData.get("id") as string;
- const name = formData.get("name") as string;
- const description = formData.get("description") as string;
- const start = formData.get("start") as string;
- const end = formData.get("end") as string;
- const location = formData.get("location") as string;
- schedule.events.push({
- name,
- id,
- description,
- slots: [
- {
- id: `${id}-1`,
- start: start + "Z",
- end: end + "Z",
- locations: [location],
- }
- ]
- });
- await broadcastUpdate(schedule);
- await writeSchedule(schedule);
- await sendPush(event, "New event", `${name} will start at ${start}`);
-});
diff --git a/server/api/delete-event.post.ts b/server/api/delete-event.post.ts
deleted file mode 100644
index 193d5d3..0000000
--- a/server/api/delete-event.post.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Schedule } from "~/shared/types/schedule";
-import { broadcastUpdate } from "~/server/streams";
-import { readSchedule, writeSchedule } from "~/server/database";
-
-export default defineEventHandler(async (event) => {
- const formData = await readFormData(event);
- const schedule: Schedule = await readSchedule();
- const id = formData.get("id") as string;
- const index = schedule.events.findIndex(event => event.id === id);
- if (index === -1) {
- throw Error("No such event");
- }
- schedule.events.splice(index, 1);
- await broadcastUpdate(schedule);
- await writeSchedule(schedule);
-});
diff --git a/server/api/modify-event.post.ts b/server/api/modify-event.post.ts
deleted file mode 100644
index a673a2b..0000000
--- a/server/api/modify-event.post.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Schedule } from "~/shared/types/schedule";
-import { broadcastUpdate } from "~/server/streams";
-import { sendPush } from "~/server/web-push";
-import { readSchedule, writeSchedule } from "~/server/database";
-
-export default defineEventHandler(async (event) => {
- const formData = await readFormData(event);
- const schedule: Schedule = await readSchedule();
- const id = formData.get("id") as string;
- const name = formData.get("name") as string;
- const description = formData.get("description") as string;
- const start = formData.get("start") as string;
- const end = formData.get("end") as string;
- const location = formData.get("location") as string;
- const index = schedule.events.findIndex(event => event.id === id);
- if (index === -1) {
- throw Error("No such event");
- }
- const timeChanged = schedule.events[index].slots[0].start !== start + "Z";
- schedule.events[index] = {
- name,
- id,
- description,
- slots: [
- {
- id: `${id}-1`,
- start: start + "Z",
- end: end + "Z",
- locations: [location],
- }
- ]
- };
- await broadcastUpdate(schedule);
- await writeSchedule(schedule);
- if (timeChanged)
- await sendPush(event, `New time for ${name}`, `${name} will now start at ${start}`);
-});