change(ui) - project update error message
This commit is contained in:
parent
a44c91f86c
commit
e25c8e2ac8
1 changed files with 9 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ import { confirm } from 'UI';
|
|||
import { clearSearch } from 'Duck/search';
|
||||
import { clearSearch as clearSearchLive } from 'Duck/liveSearch';
|
||||
import { withStore } from 'App/mstore';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
@connect(
|
||||
(state) => ({
|
||||
|
|
@ -61,9 +62,14 @@ export default class NewSiteForm extends React.PureComponent {
|
|||
return this.setState({ existsError: true });
|
||||
}
|
||||
if (site.exists()) {
|
||||
this.props.update(this.props.site, this.props.site.id).then(() => {
|
||||
this.props.onClose(null);
|
||||
this.props.fetchList();
|
||||
this.props.update(this.props.site, this.props.site.id).then((response) => {
|
||||
if (!response || !response.errors || response.errors.size === 0) {
|
||||
this.props.onClose(null);
|
||||
this.props.fetchList();
|
||||
toast.success('Project updated successfully');
|
||||
} else {
|
||||
toast.error(response.errors[0]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.props.save(this.props.site).then(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue