Compare commits

..

1 Commits

Author SHA1 Message Date
Ferdinand Thiessen 4d3654f08a [store] Rename to EventStore 2021-11-21 12:39:02 +01:00
2 changed files with 7 additions and 5 deletions

View File

@ -45,8 +45,8 @@
<script lang="ts">
import { computed, defineComponent, onBeforeMount, ref } from 'vue';
import { useEventStore } from '../../store';
import { date } from 'quasar';
import { useScheduleStore } from '../../store';
import { date, scroll } 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 = useEventStore();
const store = useScheduleStore();
const editor = ref<FG.Event | undefined>(undefined);
const events = ref<FG.Event[]>([]);

View File

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