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
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
7d68434e8c
Коммит
34c3e9e50d
@@ -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,
|
||||
|
||||
Ссылка в новой задаче
Block a user