diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2016-11-18 23:21:32 +0100 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-11-18 17:21:32 -0500 |
commit | 34c3e9e50df3dc0bc3a8d890c7fb9f999f5694ae (patch) | |
tree | d1583faaa2763bfd2a6c413c80a8ae625aec6918 /webapp/components/team_general_tab.jsx | |
parent | 7d68434e8c4c881b900fd473a8d86647a722b133 (diff) | |
download | chat-34c3e9e50df3dc0bc3a8d890c7fb9f999f5694ae.tar.gz chat-34c3e9e50df3dc0bc3a8d890c7fb9f999f5694ae.tar.bz2 chat-34c3e9e50df3dc0bc3a8d890c7fb9f999f5694ae.zip |
Move instances of Client.updateTeam() in components to an action (#4574)
* Move instances of Client.updateTeam() in components to an action
* remove client from missing ones
* update code per review
* update per code review
Diffstat (limited to 'webapp/components/team_general_tab.jsx')
-rw-r--r-- | webapp/components/team_general_tab.jsx | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/webapp/components/team_general_tab.jsx b/webapp/components/team_general_tab.jsx index 1d749f480..a5281d238 100644 --- a/webapp/components/team_general_tab.jsx +++ b/webapp/components/team_general_tab.jsx @@ -5,12 +5,11 @@ import $ from 'jquery'; import SettingItemMin from './setting_item_min.jsx'; import SettingItemMax from './setting_item_max.jsx'; -import Client from 'client/web_client.jsx'; import * as Utils from 'utils/utils.jsx'; -import TeamStore from 'stores/team_store.jsx'; import Constants from 'utils/constants.jsx'; import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl'; +import {updateTeam} from 'actions/team_actions.jsx'; const holders = defineMessages({ dirDisabled: { @@ -131,10 +130,8 @@ class GeneralTab extends React.Component { var data = this.props.team; data.allow_open_invite = this.state.allow_open_invite; - Client.updateTeam(data, - (team) => { - TeamStore.saveTeam(team); - TeamStore.emitChange(); + updateTeam(data, + () => { this.updateSection(''); }, (err) => { @@ -170,10 +167,8 @@ class GeneralTab extends React.Component { var data = this.props.team; data.display_name = this.state.name; - Client.updateTeam(data, - (team) => { - TeamStore.saveTeam(team); - TeamStore.emitChange(); + updateTeam(data, + () => { this.updateSection(''); }, (err) => { @@ -205,10 +200,8 @@ class GeneralTab extends React.Component { var data = this.props.team; data.invite_id = this.state.invite_id; - Client.updateTeam(data, - (team) => { - TeamStore.saveTeam(team); - TeamStore.emitChange(); + updateTeam(data, + () => { this.updateSection(''); }, (err) => { |