File tree Expand file tree Collapse file tree 2 files changed +23
-15
lines changed Expand file tree Collapse file tree 2 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " vuex-laravel-resource-api" ,
3- "version" : " 2.3.0 " ,
3+ "version" : " 2.3.1 " ,
44 "main" : " src/Resolver.js" ,
55 "description" : " Vue API library for easy get data from Laravel REST Controller" ,
66 "dependencies" : {
Original file line number Diff line number Diff line change 11export default {
2- 500 ( ) {
3- alert ( 'Sorry, some error at the server, please try again later...' ) ;
4- } ,
5- 401 ( ) {
6- if ( confirm ( 'You are no longer authorized. Would you like to log in?' ) )
7- window . location . reload ( ) ;
8- } ,
9- 404 ( ) {
10- alert ( 'Seems this feature is still on the developing mode, please try again later...' ) ;
11- } ,
12- def ( ) {
13- alert ( 'Sorry, some unexpected error at the server, please try again later...' ) ;
14- }
15- }
2+ 500 ( ) {
3+ alert ( 'Sorry, some error at the server, please try again later...' ) ;
4+ } ,
5+ 401 ( ) {
6+ if ( confirm ( 'You are no longer authorized. Would you like to log in?' ) )
7+ window . location . reload ( ) ;
8+ } ,
9+ 404 ( ) {
10+ alert ( 'Seems this feature is still on the developing mode, please try again later...' ) ;
11+ } ,
12+ 422 ( axResp ) {
13+ let d = axResp . response . data || { } ;
14+ let m = d . message || 'Sorry, some of data sent to the server was invalid.' ;
15+ let e = '\n\nErrors:' ;
16+ for ( let i in d . errors )
17+ e += '\n' + ( Array . isArray ( d . errors [ i ] ) && d . errors [ i ] . join ( ' ' ) || d . errors [ i ] ) ;
18+ alert ( m + e ) ;
19+ } ,
20+ def ( ) {
21+ alert ( 'Sorry, some unexpected error at the server, please try again later...' ) ;
22+ }
23+ } ;
You can’t perform that action at this time.
0 commit comments