From 289d725ad512f666bdd05e39234a71719902fd1a Mon Sep 17 00:00:00 2001 From: Ethan Chew Date: Fri, 29 Sep 2023 16:49:39 +0800 Subject: [PATCH] feat(ui): added update event --- components/admin/home/create-event-popup.vue | 4 ++-- components/admin/home/update-event-popup.vue | 19 ++++++++++++++++--- server/api/event/[id].post.ts | 4 ++-- server/api/event/index.post.ts | 4 ++-- server/utils/handlers.ts | 1 + 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/components/admin/home/create-event-popup.vue b/components/admin/home/create-event-popup.vue index bc2ec61..8e55e1e 100644 --- a/components/admin/home/create-event-popup.vue +++ b/components/admin/home/create-event-popup.vue @@ -25,8 +25,8 @@ const mutation = useMutation({ const newEventId = ref('') async function createEvent() { - event.startDateTime = new Date(event.startDateTime).getTime().toString() - event.endDateTime = new Date(event.endDateTime).getTime().toString() + event.startDateTime = (new Date(event.startDateTime).getTime()/1000).toString() + event.endDateTime = (new Date(event.endDateTime).getTime()/1000).toString() const res = await mutation.mutateAsync(event) newEventId.value = res.id diff --git a/components/admin/home/update-event-popup.vue b/components/admin/home/update-event-popup.vue index 0a1f6dd..2c1e40f 100644 --- a/components/admin/home/update-event-popup.vue +++ b/components/admin/home/update-event-popup.vue @@ -1,5 +1,6 @@