summaryrefslogtreecommitdiffstats
path: root/webapp/components/integrations/components/edit_outgoing_webhook/index.js
blob: a526ac76c4926652e9b386f4aeaea51cf7d1fd2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {updateOutgoingHook, getOutgoingHook} from 'mattermost-redux/actions/integrations';

import EditOutgoingWebhook from './edit_outgoing_webhook.jsx';

function mapStateToProps(state, ownProps) {
    const hookId = ownProps.location.query.id;

    return {
        ...ownProps,
        hookId,
        hook: state.entities.integrations.outgoingHooks[hookId],
        updateOutgoingHookRequest: state.requests.integrations.createOutgoingHook
    };
}

function mapDispatchToProps(dispatch) {
    return {
        actions: bindActionCreators({
            updateOutgoingHook,
            getOutgoingHook
        }, dispatch)
    };
}

export default connect(mapStateToProps, mapDispatchToProps)(EditOutgoingWebhook);