resources/js/vue/services/helper.js
// shows toastr notification for axios form request
shows toastr notification for axios form request
shows toastr notification for axios form request
showErrorMsg(error){
        this.setLastActivity();
        if(error.hasOwnProperty("error")){
            if (error.error.indexOf(' ') >= 0)
                toastr.error(error.error);
            else
                toastr.error(i18n.general[error.error]);
            if(error.error === 'token_expired')
                router.push('/');
        } else if(error.hasOwnProperty("response") && error.response.status == 403) {
            toastr.error(i18n.general.permission_denied);
        } else if(error.hasOwnProperty("response") && error.response.status == 422 && error.response.data.hasOwnProperty("error")) {
            toastr.error(error.response.data.error);
        } else if(error.hasOwnProperty("response") && error.response.status == 404) {
            toastr.error(i18n.general.invalid_link);
        } else if(error.errors.hasOwnProperty("message"))
            toastr.error(error.errors.message[0]);
    }
showErrorMsg ( error ) { this . setLastActivity ( ) ; if ( error . hasOwnProperty ( "error" ) ) { if ( error . error . indexOf ( ' ' ) >= 0 ) toastr . error ( error . error ) ; else toastr . error ( i18n . general [ error . error ] ) ; if ( error . error === 'token_expired' ) router . push ( '/' ) ; } else if ( error . hasOwnProperty ( "response" ) && error . response . status == 403 ) { toastr . error ( i18n . general . permission_denied ) ; } else if ( error . hasOwnProperty ( "response" ) && error . response . status == 422 && error . response . data . hasOwnProperty ( "error" ) ) { toastr . error ( error . response . data . error ) ; } else if ( error . hasOwnProperty ( "response" ) && error . response . status == 404 ) { toastr . error ( i18n . general . invalid_link ) ; } else if ( error . errors . hasOwnProperty ( "message" ) ) toastr . error ( error . errors . message [ 0 ] ) ; }
shows toastr notification for axios form request
shows toastr notification for axios form request