Compare commits

..

1 Commits

Author SHA1 Message Date
Ferdinand Thiessen 8b6fd67f1d [store] Rename to EventStore 2021-11-21 12:40:53 +01:00
2 changed files with 5 additions and 7 deletions

View File

@ -45,8 +45,8 @@
<script lang="ts">
import { computed, defineComponent, onBeforeMount, ref } from 'vue';
import { useScheduleStore } from '../../store';
import { date, scroll } from 'quasar';
import { useEventStore } from '../../store';
import { date } from 'quasar';
import EditEvent from '../management/EditEvent.vue';
import EventSlot from '../overview/slots/EventSlot.vue';
@ -59,7 +59,7 @@ export default defineComponent({
[index: string]: FG.Event[];
}
const store = useScheduleStore();
const store = useEventStore();
const editor = ref<FG.Event | undefined>(undefined);
const events = ref<FG.Event[]>([]);

View File

@ -1,5 +1,4 @@
import { api, isAxiosError } from '@flaschengeist/api';
import { AxiosError } from 'axios';
import { defineStore } from 'pinia';
interface UserService {
@ -18,7 +17,7 @@ function fixEvent(event: FG.Event) {
event.jobs.forEach((job) => fixJob(job));
}
export const useScheduleStore = defineStore({
export const useEventStore = defineStore({
id: 'events',
state: () => ({
@ -89,8 +88,7 @@ export const useScheduleStore = defineStore({
const idx = this.templates.findIndex((v) => v.id === id);
if (idx !== -1) this.templates.splice(idx, 1);
} catch (e) {
const error = <AxiosError>e;
if (error.response && error.response.status === 404) return false;
if (isAxiosError(e, 404)) return false
throw e;
}
return true;