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
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2016-11-18 23:21:32 +01:00
коммит произвёл Joram Wilander
родитель 7d68434e8c
Коммит 34c3e9e50d
4 изменённых файлов: 30 добавлений и 14 удалений

Просмотреть файл

@@ -36,6 +36,24 @@ export function createTeam(team, onSuccess, onError) {
);
}
export function updateTeam(team, onSuccess, onError) {
Client.updateTeam(team,
(rteam) => {
AppDispatcher.handleServerAction({
type: ActionTypes.UPDATE_TEAM,
team: rteam
});
browserHistory.push('/' + rteam.name + '/channels/town-square');
if (onSuccess) {
onSuccess(rteam);
}
},
onError
);
}
export function removeUserFromTeam(teamId, userId, success, error) {
Client.removeUserFromTeam(
teamId,