Skip to content

Commit

Permalink
remove unused vuex state (message, user)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Redfern committed Jan 23, 2021
1 parent 8c7e639 commit 1b284fc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
3 changes: 0 additions & 3 deletions src/store/modules/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export const mutations = {
SET_LOADING(state, loading) {
state.loading = loading;
},
SET_MESSAGE(state, message) {
state.message = message;
},
SET_ERROR(state, error) {
state.error = error;
},
Expand Down
26 changes: 0 additions & 26 deletions src/store/modules/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@ function setPaginatedUsers(commit, response) {
}

export const state = {
user: null,
users: [],
meta: null,
links: null,
loading: false,
message: null,
error: null,
};

export const mutations = {
SET_USER(state, user) {
state.user = user;
},
SET_USERS(state, users) {
state.users = users;
},
Expand All @@ -36,27 +31,12 @@ export const mutations = {
SET_LOADING(state, loading) {
state.loading = loading;
},
SET_MESSAGE(state, message) {
state.message = message;
},
SET_ERROR(state, error) {
state.error = error;
},
};

export const actions = {
getUser({ commit }, userId) {
commit("SET_LOADING", true);
UserService.getUser(userId)
.then((response) => {
commit("SET_USER", response.data.data);
commit("SET_LOADING", false);
})
.catch((error) => {
commit("SET_LOADING", false);
commit("SET_ERROR", getError(error));
});
},
getUsers({ commit }, page) {
commit("SET_LOADING", true);
UserService.getUsers(page)
Expand All @@ -82,9 +62,6 @@ export const actions = {
};

export const getters = {
user: (state) => {
return state.user;
},
users: (state) => {
return state.users;
},
Expand All @@ -97,9 +74,6 @@ export const getters = {
loading: (state) => {
return state.loading;
},
message: (state) => {
return state.message;
},
error: (state) => {
return state.error;
},
Expand Down

0 comments on commit 1b284fc

Please sign in to comment.