From c3a6af08a731a40336122b55eb46fe3eb20f6325 Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Fri, 8 Jan 2021 10:41:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=95=20Refactor=20store=20into=20module?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/package-lock.json | 38 ++++++++++ web/package.json | 2 + web/src/components/Navbar.vue | 7 +- web/src/store/index.ts | 103 ++------------------------ web/src/store/modules/athletes.ts | 0 web/src/store/modules/backend.ts | 15 ++++ web/src/store/modules/user.ts | 116 ++++++++++++++++++++++++++++++ web/src/views/DashboardHome.vue | 14 ++-- web/src/views/Profile.vue | 16 ++--- 9 files changed, 192 insertions(+), 119 deletions(-) create mode 100644 web/src/store/modules/athletes.ts create mode 100644 web/src/store/modules/backend.ts create mode 100644 web/src/store/modules/user.ts diff --git a/web/package-lock.json b/web/package-lock.json index 1de2831..0add538 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -19,6 +19,8 @@ "vue-class-component": "^8.0.0-0", "vue-router": "^4.0.0-0", "vuex": "^4.0.0-0", + "vuex-class": "^0.3.2", + "vuex-module-decorators": "^1.0.1", "vuex-persistedstate": "^4.0.0-beta.1" }, "devDependencies": { @@ -13454,6 +13456,30 @@ "vue": "^3.0.2" } }, + "node_modules/vuex-class": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/vuex-class/-/vuex-class-0.3.2.tgz", + "integrity": "sha512-m0w7/FMsNcwJgunJeM+wcNaHzK2KX1K1rw2WUQf7Q16ndXHo7pflRyOV/E8795JO/7fstyjH3EgqBI4h4n4qXQ==", + "peerDependencies": { + "vue": "^2.5.0", + "vue-class-component": "^6.0.0 || ^7.0.0", + "vuex": "^3.0.0" + } + }, + "node_modules/vuex-module-decorators": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vuex-module-decorators/-/vuex-module-decorators-1.0.1.tgz", + "integrity": "sha512-FLWZsXV5XAtl/bcKUyQFpnSBtpc3wK/7zSdy9oKbyp71mZd4ut5y2zSd219wWW9OG7WUOlVwac4rXFFDVnq7ug==", + "engines": { + "node": ">= 8", + "npm": ">= 5", + "yarn": ">= 1" + }, + "peerDependencies": { + "vue": ">=2", + "vuex": "3" + } + }, "node_modules/vuex-persistedstate": { "version": "4.0.0-beta.1", "resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-4.0.0-beta.1.tgz", @@ -25934,6 +25960,18 @@ "integrity": "sha512-HCPzYGea1xL7fMpDoMiHKujC1Bi/HM9LS5ML0Kv55zQtZJvOl0Lq7eWvJoen+SI4Lf7p9V5AqcVsoLPXNBywjg==", "requires": {} }, + "vuex-class": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/vuex-class/-/vuex-class-0.3.2.tgz", + "integrity": "sha512-m0w7/FMsNcwJgunJeM+wcNaHzK2KX1K1rw2WUQf7Q16ndXHo7pflRyOV/E8795JO/7fstyjH3EgqBI4h4n4qXQ==", + "requires": {} + }, + "vuex-module-decorators": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vuex-module-decorators/-/vuex-module-decorators-1.0.1.tgz", + "integrity": "sha512-FLWZsXV5XAtl/bcKUyQFpnSBtpc3wK/7zSdy9oKbyp71mZd4ut5y2zSd219wWW9OG7WUOlVwac4rXFFDVnq7ug==", + "requires": {} + }, "vuex-persistedstate": { "version": "4.0.0-beta.1", "resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-4.0.0-beta.1.tgz", diff --git a/web/package.json b/web/package.json index 7c796ed..23e723f 100644 --- a/web/package.json +++ b/web/package.json @@ -19,6 +19,8 @@ "vue-class-component": "^8.0.0-0", "vue-router": "^4.0.0-0", "vuex": "^4.0.0-0", + "vuex-class": "^0.3.2", + "vuex-module-decorators": "^1.0.1", "vuex-persistedstate": "^4.0.0-beta.1" }, "devDependencies": { diff --git a/web/src/components/Navbar.vue b/web/src/components/Navbar.vue index 91b8202..2c9ced3 100644 --- a/web/src/components/Navbar.vue +++ b/web/src/components/Navbar.vue @@ -26,7 +26,7 @@ - {{ username }} + {{ user.username }} @@ -47,12 +47,13 @@