@@ -11,19 +11,14 @@ function setPaginatedUsers(commit, response) {
11
11
}
12
12
13
13
export const state = {
14
- user : null ,
15
14
users : [ ] ,
16
15
meta : null ,
17
16
links : null ,
18
17
loading : false ,
19
- message : null ,
20
18
error : null ,
21
19
} ;
22
20
23
21
export const mutations = {
24
- SET_USER ( state , user ) {
25
- state . user = user ;
26
- } ,
27
22
SET_USERS ( state , users ) {
28
23
state . users = users ;
29
24
} ,
@@ -36,27 +31,12 @@ export const mutations = {
36
31
SET_LOADING ( state , loading ) {
37
32
state . loading = loading ;
38
33
} ,
39
- SET_MESSAGE ( state , message ) {
40
- state . message = message ;
41
- } ,
42
34
SET_ERROR ( state , error ) {
43
35
state . error = error ;
44
36
} ,
45
37
} ;
46
38
47
39
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
- } ,
60
40
getUsers ( { commit } , page ) {
61
41
commit ( "SET_LOADING" , true ) ;
62
42
UserService . getUsers ( page )
@@ -82,9 +62,6 @@ export const actions = {
82
62
} ;
83
63
84
64
export const getters = {
85
- user : ( state ) => {
86
- return state . user ;
87
- } ,
88
65
users : ( state ) => {
89
66
return state . users ;
90
67
} ,
@@ -97,9 +74,6 @@ export const getters = {
97
74
loading : ( state ) => {
98
75
return state . loading ;
99
76
} ,
100
- message : ( state ) => {
101
- return state . message ;
102
- } ,
103
77
error : ( state ) => {
104
78
return state . error ;
105
79
} ,
0 commit comments