Fix form state locking on save
This commit is contained in:
parent
f449f49107
commit
52f8217b77
|
@ -225,12 +225,14 @@ class TheFormDef extends React.PureComponent {
|
||||||
this.setState({ loading: false })
|
this.setState({ loading: false })
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
notification["error"]({ message: "Error", description: e.message })
|
notification["error"]({ message: "Error", description: e.message })
|
||||||
|
this.setState({ loading: false })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.props.modelRequest(cs.ModelCampaigns, cs.Routes.UpdateCampaign, cs.MethodPut, { ...values, id: this.props.record.id }).then((resp) => {
|
this.props.modelRequest(cs.ModelCampaigns, cs.Routes.UpdateCampaign, cs.MethodPut, { ...values, id: this.props.record.id }).then((resp) => {
|
||||||
notification["success"]({ placement: "topRight",
|
notification["success"]({ placement: "topRight",
|
||||||
message: "Campaign updated",
|
message: "Campaign updated",
|
||||||
description: `"${values["name"]}" updated` })
|
description: `"${values["name"]}" updated` })
|
||||||
|
this.setState({ loading: false })
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
notification["error"]({ message: "Error", description: e.message })
|
notification["error"]({ message: "Error", description: e.message })
|
||||||
this.setState({ loading: false })
|
this.setState({ loading: false })
|
||||||
|
|
Loading…
Reference in New Issue