Move instances of Client.updateChannelHeader() in components to an action (#5098)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
a5b5dabf4a
Коммит
8f0175e15c
@@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user