Compare commits
1 Commits
8b6fd67f1d
...
4d3654f08a
Author | SHA1 | Date |
---|---|---|
Ferdinand Thiessen | 4d3654f08a |
|
@ -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[]>([]);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue