Skip to content

Commit 1b284fc

Browse files
author
Gareth Redfern
committed
remove unused vuex state (message, user)
1 parent 8c7e639 commit 1b284fc

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/store/modules/Auth.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ export const mutations = {
1717
SET_LOADING(state, loading) {
1818
state.loading = loading;
1919
},
20-
SET_MESSAGE(state, message) {
21-
state.message = message;
22-
},
2320
SET_ERROR(state, error) {
2421
state.error = error;
2522
},

src/store/modules/User.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,14 @@ function setPaginatedUsers(commit, response) {
1111
}
1212

1313
export const state = {
14-
user: null,
1514
users: [],
1615
meta: null,
1716
links: null,
1817
loading: false,
19-
message: null,
2018
error: null,
2119
};
2220

2321
export const mutations = {
24-
SET_USER(state, user) {
25-
state.user = user;
26-
},
2722
SET_USERS(state, users) {
2823
state.users = users;
2924
},
@@ -36,27 +31,12 @@ export const mutations = {
3631
SET_LOADING(state, loading) {
3732
state.loading = loading;
3833
},
39-
SET_MESSAGE(state, message) {
40-
state.message = message;
41-
},
4234
SET_ERROR(state, error) {
4335
state.error = error;
4436
},
4537
};
4638

4739
export const actions = {
48-
getUser({ commit }, userId) {
49-
commit("SET_LOADING", true);
50-
UserService.getUser(userId)
51-
.then((response) => {
52-
commit("SET_USER", response.data.data);
53-
commit("SET_LOADING", false);
54-
})
55-
.catch((error) => {
56-
commit("SET_LOADING", false);
57-
commit("SET_ERROR", getError(error));
58-
});
59-
},
6040
getUsers({ commit }, page) {
6141
commit("SET_LOADING", true);
6242
UserService.getUsers(page)
@@ -82,9 +62,6 @@ export const actions = {
8262
};
8363

8464
export const getters = {
85-
user: (state) => {
86-
return state.user;
87-
},
8865
users: (state) => {
8966
return state.users;
9067
},
@@ -97,9 +74,6 @@ export const getters = {
9774
loading: (state) => {
9875
return state.loading;
9976
},
100-
message: (state) => {
101-
return state.message;
102-
},
10377
error: (state) => {
10478
return state.error;
10579
},

0 commit comments

Comments
 (0)