diff --git a/src/components/Events/EventItem.vue b/src/components/Events/EventItem.vue index 3a49efd7..2d24617c 100644 --- a/src/components/Events/EventItem.vue +++ b/src/components/Events/EventItem.vue @@ -2,7 +2,6 @@ import { ref, onMounted, onUnmounted } from 'vue' import apis, { - EventDetail, Event, EditEventRequest, EventLevel @@ -27,15 +26,14 @@ const props = defineProps() const displayMenu = ref(false) -const eventDetail: EventDetail = (await apis.getEvent(props.event.id)).data const eventLevelValue = ref( - eventLevelValueMap[eventDetail.eventLevel] + eventLevelValueMap[props.event.level] ) const updateEventLevel = async (v: EventLevelValue) => { eventLevelValue.value = v const currentEventLevel: EventLevel = getEventLevelFromValue(v) - const editReq: EditEventRequest = { eventLevel: currentEventLevel } + const editReq: EditEventRequest = { level: currentEventLevel } await apis.editEvent(props.event.id, editReq) useEventStore().mutate() } diff --git a/src/pages/Event.vue b/src/pages/Event.vue index 9c10bcc1..7e95aea4 100644 --- a/src/pages/Event.vue +++ b/src/pages/Event.vue @@ -25,14 +25,14 @@ const { mutate } = useEventStore() const eventId = useParam('id') const event: EventDetail = (await apis.getEvent(eventId.value)).data -const eventLevel = ref(eventLevelValueMap[event.eventLevel]) +const eventLevel = ref(eventLevelValueMap[event.level]) const isSending = ref(false) const updateEvent = async () => { isSending.value = true try { const requestData: EditEventRequest = { - eventLevel: getEventLevelFromValue(eventLevel.value) + level: getEventLevelFromValue(eventLevel.value) } await apis.editEvent(eventId.value, requestData) mutate()