How to use the xadmin.app.error function in xadmin

To help you get started, we’ve selected a few xadmin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sshwsfc / xadmin / packages / xadmin-auth / src / effects.js View on Github external
function *handle_user_signout() {
  const { _t } = app.context
  try{
    yield api({ name: 'auth/logout' }).save({})
    yield put({ type: '@@xadmin/AUTH_SIGN_OUT_FINISH' })
    yield put({ type: '@@xadmin/ADD_NOTICE', payload: {
      type: 'success', headline: 'Success', message: _t('Successfully logged out')
    } })
  } catch(err) { 
    app.error(err)
  }
}
github sshwsfc / xadmin / packages / xadmin-auth / src / effects.js View on Github external
function *handle_get_userinfo({ type }) {
  try{
    const user = yield api({ name: 'auth' }).get('user')
    yield put({ type, payload: user, success: true })
  } catch(err) { 
    app.error(err)
  }
}
github sshwsfc / xadmin / packages / xadmin-auth / src / effects.js View on Github external
function *handle_verify_email({ payload }) {
  const { _t } = app.context
  try {
    yield api({ name: 'auth/registration/verify-email' }).save({
      language: 'zh_CN',
      ...payload
    })
    yield put({ type: '@@xadmin/ADD_NOTICE', payload: {
      type: 'success', headline: 'Success', message: _t('Send verify code to your email, please check')
    } })
  } catch(err) {
    app.error(err)
  }
}