Fix form state locking on save

This commit is contained in:
Kailash Nadh 2018-10-30 11:18:15 +05:30
parent f449f49107
commit 52f8217b77
1 changed files with 2 additions and 0 deletions

View File

@ -225,12 +225,14 @@ class TheFormDef extends React.PureComponent {
this.setState({ loading: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
this.setState({ loading: false })
})
} else {
this.props.modelRequest(cs.ModelCampaigns, cs.Routes.UpdateCampaign, cs.MethodPut, { ...values, id: this.props.record.id }).then((resp) => {
notification["success"]({ placement: "topRight",
message: "Campaign updated",
description: `"${values["name"]}" updated` })
this.setState({ loading: false })
}).catch(e => {
notification["error"]({ message: "Error", description: e.message })
this.setState({ loading: false })