fix: Fix notify with promise reject
1. Fix notify with promise reject 2. Fix constants module import Change-Id: I36d70c9421b1df26a379d692490a64f82654ea12
This commit is contained in:
parent
e915d13e4a
commit
8788c7a2e5
@ -515,7 +515,7 @@ export default class BaseList extends React.Component {
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('fetch list error', e);
|
||||
const { message = '', data, status } = e.response || e || {};
|
||||
const { message = '', data, status } = (e || {}).response || e || {};
|
||||
if (status === 500) {
|
||||
const sysErr = t('System is error, please try again later.');
|
||||
const title = `${t('Get {name} error.', {
|
||||
|
@ -245,7 +245,7 @@ export default class DetailBase extends React.Component {
|
||||
catch = (e) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(e);
|
||||
const { data, status } = e.response || e || {};
|
||||
const { data, status } = (e || {}).response || e || {};
|
||||
if (status === 404) {
|
||||
this.setState({ notFound: true });
|
||||
Notify.warn(
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
import Axios from 'axios';
|
||||
import { getLocalStorageItem } from 'utils/local-storage';
|
||||
import { getOpenstackApiVersion } from 'utils/constants';
|
||||
import { getOpenstackApiVersion } from 'client/client/constants';
|
||||
import Notify from 'components/Notify';
|
||||
import { isEqual } from 'lodash';
|
||||
import baseURL from './base-url';
|
||||
|
Loading…
Reference in New Issue
Block a user