From ed41acfdd99568d784c4ff87dde39c19627b9f50 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 19 Oct 2020 01:44:48 +0200 Subject: [PATCH] Remove unneeded files --- src/store/module-user/actions.ts | 25 ------------------------- src/store/module-user/getters.ts | 12 ------------ src/store/module-user/index.ts | 16 ---------------- src/store/module-user/mutations.ts | 16 ---------------- src/store/module-user/state.ts | 29 ----------------------------- 5 files changed, 98 deletions(-) delete mode 100644 src/store/module-user/actions.ts delete mode 100644 src/store/module-user/getters.ts delete mode 100644 src/store/module-user/index.ts delete mode 100644 src/store/module-user/mutations.ts delete mode 100644 src/store/module-user/state.ts diff --git a/src/store/module-user/actions.ts b/src/store/module-user/actions.ts deleted file mode 100644 index 623c2b6..0000000 --- a/src/store/module-user/actions.ts +++ /dev/null @@ -1,25 +0,0 @@ -import axios from 'axios'; -import { ActionTree } from 'vuex'; -import { StateInterface } from '../index'; -import { UserStateInterface } from './state'; - -const actions: ActionTree = { - login ({ commit }, payload): any { - axios.post("/auth", { - userid: payload.userid, - password: payload.password - }).then(function (response) { - let token = (response.data).token; - console.log(token); - if (token) - token.expires = new Date(token.expires); - commit('setUser', (response.data).user); - commit('setToken', token); - commit('setPermissions', (response.data).permissions); - }).catch(function (error) { - console.error(error); - }); - } -}; - -export default actions; diff --git a/src/store/module-user/getters.ts b/src/store/module-user/getters.ts deleted file mode 100644 index f379c04..0000000 --- a/src/store/module-user/getters.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { GetterTree } from 'vuex'; -import { StateInterface } from '../index'; -import { UserStateInterface } from './state'; - -const getters: GetterTree = { - someAction (/* context */) { - console.log("GOOOOOOOOOOOOOOOOOOO"); - // your code - } -}; - -export default getters; diff --git a/src/store/module-user/index.ts b/src/store/module-user/index.ts deleted file mode 100644 index 9bf3797..0000000 --- a/src/store/module-user/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Module } from 'vuex'; -import { StateInterface } from '../index'; -import state, { UserStateInterface } from './state'; -import actions from './actions'; -import getters from './getters'; -import mutations from './mutations'; - -const exampleModule: Module = { - namespaced: true, - actions, - getters, - mutations, - state -}; - -export default exampleModule; diff --git a/src/store/module-user/mutations.ts b/src/store/module-user/mutations.ts deleted file mode 100644 index 33686cd..0000000 --- a/src/store/module-user/mutations.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MutationTree } from 'vuex'; -import { TokenInterface, UserInterface, UserStateInterface } from './state'; - -const mutation: MutationTree = { - setToken (state: UserStateInterface, token: TokenInterface) { - state.token = token - }, - setUser (state: UserStateInterface, user: UserInterface) { - state.user = user - }, - setPermissions (state: UserStateInterface, permissions: Array) { - state.permissions = permissions - } -}; - -export default mutation; diff --git a/src/store/module-user/state.ts b/src/store/module-user/state.ts deleted file mode 100644 index a51bea7..0000000 --- a/src/store/module-user/state.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface TokenInterface { - token: string, - expires: Date, - lifetime: number, - browser: string, - platform: string -} - -export interface UserInterface { - display_name: string | null, - firstname: string, - lastname: string, - mail: string | null, - roles: Array -} - -export interface UserStateInterface { - token: TokenInterface | null, - user: UserInterface | null, - permissions: Array -}; - -const state: UserStateInterface = { - token: null, - user: null, - permissions: [] -}; - -export default state; \ No newline at end of file