Move instances of Client.updateChannelHeader() in components to an action (#5098)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-01-17 21:49:58 +01:00
коммит произвёл Christopher Speller
родитель a5b5dabf4a
Коммит 8f0175e15c
2 изменённых файлов: 25 добавлений и 9 удалений

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

@@ -321,3 +321,25 @@ export function createChannel(channel, success, error) {
}
);
}
export function updateChannelHeader(channelId, header, success, error) {
Client.updateChannelHeader(
channelId,
header,
(channelData) => {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_CHANNEL,
channel: channelData
});
if (success) {
success(channelData);
}
},
(err) => {
if (error) {
error(err);
}
}
);
}