From b8ecd2e4634eaa3bcf68be2ffc6d532fd9077ad7 Mon Sep 17 00:00:00 2001 From: Juan Carlos Ruvalcaba Date: Fri, 23 Jul 2021 13:31:27 -0700 Subject: [PATCH] Updates: -Disable location variable on user store file -Add .js extension to some imports. --- src/js/routes/home.js | 2 +- src/js/routes/users.js | 2 +- src/js/stores/user.js | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/js/routes/home.js b/src/js/routes/home.js index ff4e67e..7435a65 100644 --- a/src/js/routes/home.js +++ b/src/js/routes/home.js @@ -2,7 +2,7 @@ import HomePage from '../../pages/home.f7.html'; import LeftPanelPage from '../../pages/home/panel-left.f7.html'; import RightPanelPage from '../../pages/home/panel-right.f7.html'; -import Check from './../controllers/check'; +import Check from './../controllers/check.js'; const home = [ { diff --git a/src/js/routes/users.js b/src/js/routes/users.js index 3f82a73..51ee2ab 100644 --- a/src/js/routes/users.js +++ b/src/js/routes/users.js @@ -2,7 +2,7 @@ import UserEditPage from '../../pages/user/edit-data.f7.html'; import UserNewPage from '../../pages/user/new-data.f7.html'; import UserResetPage from '../../pages/user/reset-data.f7.html'; -import Check from '../controllers/check'; +import Check from '../controllers/check.js'; const users = [ { diff --git a/src/js/stores/user.js b/src/js/stores/user.js index 43048bc..27f6860 100644 --- a/src/js/stores/user.js +++ b/src/js/stores/user.js @@ -7,22 +7,22 @@ const user = createStore({ token: '', user: {}, roles: [], - location: {}, + //location: {}, }, actions: { - async setBasicData({ dispatch }, { token, user, roles, location }){ + async setBasicData({ dispatch }, { token, user, roles/*, location*/ }){ await localForage.setItem('user', user); await localForage.setItem('token', token); await localForage.setItem('roles', roles); - await localForage.setItem('location', location); - dispatch('auth_success', { token, user, roles, location }); + //await localForage.setItem('location', location); + dispatch('auth_success', { token, user, roles/*, location*/ }); }, async getBasicData({ dispatch }){ const result = { user: await localForage.getItem('user'), token: await localForage.getItem('token'), roles: await localForage.getItem('roles'), - location: await localForage.getItem('location'), + //location: await localForage.getItem('location'), } dispatch('auth_success', result); }, @@ -30,7 +30,7 @@ const user = createStore({ await localForage.deleteItem('user'); await localForage.deleteItem('token'); await localForage.deleteItem('roles'); - await localForage.deleteItem('location'); + //await localForage.deleteItem('location'); }, async checkData({ dispatch }){ let token = await localForage.getItem('token'); @@ -48,7 +48,7 @@ const user = createStore({ delete response.data.token; delete response.data.roles; - delete response.data.location; + //delete response.data.location; return response; } @@ -69,17 +69,17 @@ const user = createStore({ state.token = ''; state.user = {}; state.roles = []; - state.location = {}; + //state.location = {}; }, auth_request({ state }){ state.status = 'loading'; }, - auth_success({ state }, { token, user, roles, location }){ + auth_success({ state }, { token, user, roles/*, location*/ }){ state.status = 'success'; state.token = token; state.user = user; state.roles = roles; - state.location = location; + //state.location = location; }, auth_error({ state }){ state.status = 'error' @@ -99,9 +99,9 @@ const user = createStore({ roles({ state }){ return state.roles; }, - location({ state }){ - return state.location - }, + // location({ state }){ + // return state.location + // }, displayName({ state }){ return state.user; }