@@ -9,7 +9,7 @@ const actions = {
99 commit ( 'setItems' , response . body )
1010 commit ( 'setLoadingStatus' , false )
1111 } , ( error ) => {
12- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
12+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
1313 } )
1414 } ,
1515 getItemsServerSide ( { commit, getters, dispatch } , [ params ] ) {
@@ -20,7 +20,7 @@ const actions = {
2020 commit ( 'setItemsServerSide' , response . body )
2121 resolve ( )
2222 } , ( error ) => {
23- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
23+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
2424 reject ( error )
2525 } )
2626 } )
@@ -35,7 +35,7 @@ const actions = {
3535 commit ( 'setDetailsLoader' , false )
3636 resolve ( )
3737 } , ( error ) => {
38- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
38+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
3939 reject ( error )
4040 } )
4141 } )
@@ -47,16 +47,16 @@ const actions = {
4747 Vue . http . put ( `${ getters . path ( 'u' ) } /${ id } ` , params )
4848 . then ( ( response ) => {
4949 if ( response . body . status === 0 ) {
50- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
50+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
5151 dispatch ( 'runTableRefreshing' )
5252 resolve ( )
5353 } else if ( response . body . status === - 1 ) {
54- dispatch ( 'openAlertBox' , 'alertError' , response . body . msg , { root : true } )
54+ dispatch ( 'openAlertBox' , [ 'alertError' , response . body . msg ] , { root : true } )
5555 } else if ( response . body . status === - 2 ) {
56- dispatch ( 'openAlertBox' , 'alertValidationError' , response . body . msg , { root : true } )
56+ dispatch ( 'openAlertBox' , [ 'alertValidationError' , response . body . msg ] , { root : true } )
5757 }
5858 } , ( error ) => {
59- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
59+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
6060 reject ( error )
6161 } )
6262 } )
@@ -68,19 +68,19 @@ const actions = {
6868 Vue . http . post ( getters . path ( 'st' ) , params )
6969 . then ( ( response ) => {
7070 if ( response . body . status === 0 ) {
71- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
71+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
7272 dispatch ( 'runTableRefreshing' )
7373 resolve ( )
7474 } else if ( response . body . status === - 1 ) {
75- dispatch ( 'openAlertBox' , 'alertError' , response . body . msg , { root : true } )
75+ dispatch ( 'openAlertBox' , [ 'alertError' , response . body . msg ] , { root : true } )
7676 } else if ( response . body . status === - 2 ) {
77- dispatch ( 'openAlertBox' , 'alertValidationError' , response . body . msg , { root : true } )
77+ dispatch ( 'openAlertBox' , [ 'alertValidationError' , response . body . msg ] , { root : true } )
7878 }
7979 if ( state . createdElement . mode === 'inform' ) {
8080 commit ( 'setCreatedItemStatus' , [ true , response . body . id ] )
8181 }
8282 } , ( error ) => {
83- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
83+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
8484 reject ( error )
8585 } )
8686 } )
@@ -90,32 +90,32 @@ const actions = {
9090 } , [ id , successText , errorText ] ) {
9191 Vue . http . delete ( `${ getters . path ( 'd' ) } /${ id } ` )
9292 . then ( ( ) => {
93- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
93+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
9494 dispatch ( 'runTableRefreshing' )
9595 } , ( ) => {
96- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
96+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
9797 } )
9898 } ,
9999 mulitipleItemsUpdate ( {
100100 getters, dispatch
101101 } , [ params , successText , errorText ] ) {
102102 Vue . http . post ( `${ getters . path ( 'mu' ) } /multiple-update` , params )
103103 . then ( ( ) => {
104- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
104+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
105105 dispatch ( 'runTableRefreshing' )
106106 } , ( ) => {
107- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
107+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
108108 } )
109109 } ,
110110 mulitipleItemsDelete ( {
111111 getters, dispatch
112112 } , [ ids , successText , errorText ] ) {
113113 Vue . http . post ( `${ getters . path ( 'md' ) } /multiple-delete` , ids )
114114 . then ( ( ) => {
115- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
115+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
116116 dispatch ( 'runTableRefreshing' )
117117 } , ( ) => {
118- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
118+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
119119 } )
120120 } ,
121121 // item elements
@@ -129,43 +129,43 @@ const actions = {
129129 } , [ params , successText , errorText ] ) {
130130 Vue . http . post ( state . itemElements . controller , params )
131131 . then ( ( ) => {
132- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
132+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
133133 dispatch ( 'getItemElements' )
134134 } , ( ) => {
135- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
135+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
136136 } )
137137 } ,
138138 removeItemElement ( {
139139 dispatch, state
140140 } , [ id , successText , errorText ] ) {
141141 Vue . http . delete ( `${ state . itemElements . controller } /${ id } ` )
142142 . then ( ( ) => {
143- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
143+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
144144 dispatch ( 'getItemElements' )
145145 } , ( ) => {
146- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
146+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
147147 } )
148148 } ,
149149 addManyItemElements ( {
150150 dispatch, state
151151 } , [ params , successText , errorText ] ) {
152152 Vue . http . post ( `${ state . itemElements . controller } /multiple-add` , params )
153153 . then ( ( ) => {
154- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
154+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
155155 dispatch ( 'getItemElements' )
156156 } , ( ) => {
157- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
157+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
158158 } )
159159 } ,
160160 removeManyItemElements ( {
161161 dispatch, state
162162 } , [ ids , successText , errorText ] ) {
163163 Vue . http . post ( `${ state . itemElements . controller } /multiple-delete` , ids )
164164 . then ( ( ) => {
165- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
165+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
166166 dispatch ( 'getItemElements' )
167167 } , ( ) => {
168- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
168+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
169169 } )
170170 } ,
171171 // extented details
@@ -178,7 +178,7 @@ const actions = {
178178 commit ( 'setDetailsLoader' , false )
179179 resolve ( )
180180 } , ( error ) => {
181- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
181+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
182182 reject ( error )
183183 } )
184184 } )
@@ -189,15 +189,15 @@ const actions = {
189189 Vue . http . put ( `${ getters . path ( 'u' ) } /${ id } ` , params )
190190 . then ( ( response ) => {
191191 if ( response . body . status === 0 ) {
192- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
192+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
193193 } else if ( response . body . status === - 1 ) {
194- dispatch ( 'openAlertBox' , 'alertError' , response . body . msg , { root : true } )
194+ dispatch ( 'openAlertBox' , [ 'alertError' , response . body . msg ] , { root : true } )
195195 } else if ( response . body . status === - 2 ) {
196- dispatch ( 'openAlertBox' , 'alertValidationError' , response . body . msg , { root : true } )
196+ dispatch ( 'openAlertBox' , [ 'alertValidationError' , response . body . msg ] , { root : true } )
197197 }
198198 dispatch ( 'getItemDetails' , [ state . item [ state . itemIdColumn ] ] )
199199 } , ( error ) => {
200- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
200+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
201201 } )
202202 } ,
203203 // child details
@@ -208,16 +208,16 @@ const actions = {
208208 Vue . http . put ( `${ path } /${ id } ` , params )
209209 . then ( ( response ) => {
210210 if ( response . body . status === 0 ) {
211- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
211+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
212212 resolve ( )
213213 } else if ( response . body . status === - 1 ) {
214- dispatch ( 'openAlertBox' , 'alertError' , response . body . msg , { root : true } )
214+ dispatch ( 'openAlertBox' , [ 'alertError' , response . body . msg ] , { root : true } )
215215 } else if ( response . body . status === - 2 ) {
216- dispatch ( 'openAlertBox' , 'alertValidationError' , response . body . msg , { root : true } )
216+ dispatch ( 'openAlertBox' , [ 'alertValidationError' , response . body . msg ] , { root : true } )
217217 }
218218 dispatch ( 'getItemDetails' , [ state . item [ state . itemIdColumn ] ] )
219219 } , ( error ) => {
220- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
220+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
221221 reject ( error )
222222 } )
223223 } )
@@ -228,15 +228,15 @@ const actions = {
228228 Vue . http . delete ( `${ path } /${ id } ` )
229229 . then ( ( response ) => {
230230 if ( response . body . status === 0 ) {
231- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
231+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
232232 } else if ( response . body . status === - 1 ) {
233- dispatch ( 'openAlertBox' , 'alertError' , response . body . msg , { root : true } )
233+ dispatch ( 'openAlertBox' , [ 'alertError' , response . body . msg ] , { root : true } )
234234 } else if ( response . body . status === - 2 ) {
235- dispatch ( 'openAlertBox' , 'alertValidationError' , response . body . msg , { root : true } )
235+ dispatch ( 'openAlertBox' , [ 'alertValidationError' , response . body . msg ] , { root : true } )
236236 }
237237 dispatch ( 'getItemDetails' , [ state . item [ state . itemIdColumn ] ] )
238238 } , ( ) => {
239- dispatch ( 'openAlertBox' , 'alertError' , errorText , { root : true } )
239+ dispatch ( 'openAlertBox' , [ 'alertError' , errorText ] , { root : true } )
240240 } )
241241 } ,
242242 storeChild ( {
@@ -246,16 +246,16 @@ const actions = {
246246 Vue . http . post ( path , params )
247247 . then ( ( response ) => {
248248 if ( response . body . status === 0 ) {
249- dispatch ( 'openAlertBox' , 'alertSuccess' , successText , { root : true } )
249+ dispatch ( 'openAlertBox' , [ 'alertSuccess' , successText ] , { root : true } )
250250 resolve ( )
251251 } else if ( response . body . status === - 1 ) {
252- dispatch ( 'openAlertBox' , 'alertError' , response . body . msg , { root : true } )
252+ dispatch ( 'openAlertBox' , [ 'alertError' , response . body . msg ] , { root : true } )
253253 } else if ( response . body . status === - 2 ) {
254- dispatch ( 'openAlertBox' , 'alertValidationError' , response . body . msg , { root : true } )
254+ dispatch ( 'openAlertBox' , [ 'alertValidationError' , response . body . msg ] , { root : true } )
255255 }
256256 dispatch ( 'getItemDetails' , [ state . item [ state . itemIdColumn ] ] )
257257 } , ( error ) => {
258- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
258+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
259259 reject ( error )
260260 } )
261261 } )
@@ -267,7 +267,7 @@ const actions = {
267267 commit ( 'setChild' , [ response . body , childItemName ] )
268268 resolve ( )
269269 } , ( error ) => {
270- dispatch ( 'openAlertBox' , 'alertError' , error . statusText , { root : true } )
270+ dispatch ( 'openAlertBox' , [ 'alertError' , error . statusText ] , { root : true } )
271271 } )
272272 } )
273273 } ,
0 commit comments