From 2b0d5d2a6db017f5eaeb88a4ec71a9590854e9c3 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 4 Dec 2020 01:29:05 +0300 Subject: feat: add type to event --- src/components/EventCard/EventCard.tsx | 2 +- src/containers/BsuFantomSection/EventForm.tsx | 3 ++- src/types.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/EventCard/EventCard.tsx b/src/components/EventCard/EventCard.tsx index 67a89e7..179a868 100644 --- a/src/components/EventCard/EventCard.tsx +++ b/src/components/EventCard/EventCard.tsx @@ -57,12 +57,12 @@ const EventCard: React.FC = ({ event, mutate }) => { const classes = useStyles(); const { user } = useAuth(); const { - name, schedule, status, nextRunAt, lastRunAt, context: { + name, participants, conferenceId, attendanceId diff --git a/src/containers/BsuFantomSection/EventForm.tsx b/src/containers/BsuFantomSection/EventForm.tsx index 528636f..64d4165 100644 --- a/src/containers/BsuFantomSection/EventForm.tsx +++ b/src/containers/BsuFantomSection/EventForm.tsx @@ -20,9 +20,10 @@ const EventForm: React.FC = ({ mutate }) => { const handleSubmit = () => { if (schedule && conferenceId) { const event: Partial = { - name, + type: 'class', schedule, context: { + name, attendanceId, conferenceId, participants: [] diff --git a/src/types.ts b/src/types.ts index 941bbbb..e41223c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,13 +9,14 @@ export interface User extends Base { } export interface EventContext { + name: string; participants: string[]; conferenceId: string; attendanceId: string; } export interface Event extends Base { - name: string; + type: string; schedule: string; status?: 'running' | 'complete' | 'failed' | 'notStarted'; failReason?: string; -- cgit v1.2.3