diff --git a/frontend/app/components/Client/Integrations/SlackAddForm/SlackAddForm.js b/frontend/app/components/Client/Integrations/SlackAddForm/SlackAddForm.js index 754146a36..16586fd1d 100644 --- a/frontend/app/components/Client/Integrations/SlackAddForm/SlackAddForm.js +++ b/frontend/app/components/Client/Integrations/SlackAddForm/SlackAddForm.js @@ -1,20 +1,22 @@ import React from 'react' import { connect } from 'react-redux' -import { edit, save, init } from 'Duck/integrations/slack' +import { edit, save, init, update } from 'Duck/integrations/slack' import { Form, Input, Button, Message } from 'UI' import { confirm } from 'UI/Confirmation'; import { remove } from 'Duck/integrations/slack' class SlackAddForm extends React.PureComponent { - componentWillUnmount() { this.props.init({}); } save = () => { - this.props.save(this.props.instance).then(function() { - - }) + const instance = this.props.instance; + if(instance.exists()) { + this.props.update(this.props.instance) + } else { + this.props.save(this.props.instance) + } } remove = async (id) => { @@ -102,4 +104,4 @@ export default connect(state => ({ instance: state.getIn(['slack', 'instance']), saving: state.getIn(['slack', 'saveRequest', 'loading']), errors: state.getIn([ 'slack', 'saveRequest', 'errors' ]), -}), { edit, save, init, remove })(SlackAddForm) \ No newline at end of file +}), { edit, save, init, remove, update })(SlackAddForm) \ No newline at end of file diff --git a/frontend/app/components/Client/Integrations/SlackChannelList/SlackChannelList.js b/frontend/app/components/Client/Integrations/SlackChannelList/SlackChannelList.js index 88529ce58..6c7909169 100644 --- a/frontend/app/components/Client/Integrations/SlackChannelList/SlackChannelList.js +++ b/frontend/app/components/Client/Integrations/SlackChannelList/SlackChannelList.js @@ -24,15 +24,11 @@ function SlackChannelList(props) { className="border-t px-5 py-2 flex items-center justify-between cursor-pointer" onClick={() => onEdit(c)} > -
+
{c.name}
- - {c.endpoint} -
- } - /> +
+ {c.endpoint} +
{/*