From a8ad2f1da5c3d080fee21a5ed231bd86849e5aea Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 28 Jan 2021 23:08:34 +0100 Subject: [PATCH] Code formatting with prettier --- .gitignore | 3 +++ .../components/management/CreateEvent.vue | 4 +-- src/plugins/user/store/session.ts | 26 +++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 553e134..3bfb608 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ .thumbs.db node_modules +# We use yarn, so ignore npm +package-lock.json + # Quasar core related directories .quasar /dist diff --git a/src/plugins/schedule/components/management/CreateEvent.vue b/src/plugins/schedule/components/management/CreateEvent.vue index d3798f5..6999bdb 100644 --- a/src/plugins/schedule/components/management/CreateEvent.vue +++ b/src/plugins/schedule/components/management/CreateEvent.vue @@ -3,7 +3,7 @@ - +
Veranstaltung erstellen
- + = { @@ -44,11 +44,11 @@ const mutations: MutationTree = { state.loading = value; }, updateSession(state, session: FG.Session) { - const index = state.sessions.findIndex((x) => x.token == session.token); + const index = state.sessions.findIndex(x => x.token == session.token); if (index > -1) { state.sessions[index] = session; } - }, + } }; const actions: ActionTree = { @@ -65,7 +65,7 @@ const actions: ActionTree = { commit('setCurrentSession', response.data.session); commit('user/setCurrentUser', response.data.user, { root: true }); commit('user/setCurrentPermissions', response.data.permissions, { - root: true, + root: true }); }) .catch((error: AxiosError) => { @@ -78,7 +78,7 @@ const actions: ActionTree = { */ logout({ dispatch, rootState }) { if (rootState.session.currentSession) { - dispatch('deleteSession', rootState.session.currentSession.token).catch((error) => { + dispatch('deleteSession', rootState.session.currentSession.token).catch(error => { console.log(error); void dispatch('clearCurrent', false); }); @@ -97,7 +97,7 @@ const actions: ActionTree = { if (token === rootState.session.currentSession?.token) { void dispatch('clearCurrent', false); } else { - dispatch('getSessions').catch((error) => { + dispatch('getSessions').catch(error => { throw error; }); } @@ -116,7 +116,7 @@ const actions: ActionTree = { void Router.push({ name: 'login', query: redirect ? { redirect: Router.currentRoute.fullPath } : {}, - params: { logout: 'true' }, + params: { logout: 'true' } }).then(() => { commit('clearCurrentSession'); commit('user/clearCurrentUser', null, { root: true }); @@ -132,7 +132,7 @@ const actions: ActionTree = { axios .get('/auth') .then((response: AxiosResponse) => { - response.data.forEach((session) => { + response.data.forEach(session => { session.expires = new Date(session.expires); }); commit('setSessions', response.data); @@ -143,7 +143,7 @@ const actions: ActionTree = { commit('setCurrentSession', currentSession); } }) - .catch((error) => { + .catch(error => { throw error; }) .finally(() => { @@ -160,7 +160,7 @@ const actions: ActionTree = { commit('setCurrentSession', response.data); } }) - .catch((err) => console.log(err)) + .catch(err => console.log(err)) .finally(() => { commit('setLoading', false); }); @@ -173,7 +173,7 @@ const actions: ActionTree = { return axios.post('/auth/reset', data).catch((error: AxiosError) => { return Promise.reject(error.response); }); - }, + } }; const getters: GetterTree = { @@ -185,7 +185,7 @@ const getters: GetterTree = { }, loading(state) { return state.loading; - }, + } }; const sessions: Module = { @@ -193,7 +193,7 @@ const sessions: Module = { state, mutations, actions, - getters, + getters }; export default sessions;