summaryrefslogtreecommitdiffstats
path: root/webapp/actions/channel_actions.jsx
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2017-01-17 21:49:58 +0100
committerChristopher Speller <crspeller@gmail.com>2017-01-17 15:49:58 -0500
commit8f0175e15c4d6bd08ca6795851455468811c3dc9 (patch)
treec1fd3db6cdfc9c380d39bf1f1a6fd6ca2ffaa145 /webapp/actions/channel_actions.jsx
parenta5b5dabf4a150b78f5f937a7d287b24d5b8d0647 (diff)
downloadchat-8f0175e15c4d6bd08ca6795851455468811c3dc9.tar.gz
chat-8f0175e15c4d6bd08ca6795851455468811c3dc9.tar.bz2
chat-8f0175e15c4d6bd08ca6795851455468811c3dc9.zip
Move instances of Client.updateChannelHeader() in components to an action (#5098)
Diffstat (limited to 'webapp/actions/channel_actions.jsx')
-rw-r--r--webapp/actions/channel_actions.jsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index 6cf8449f0..40e0cde30 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -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);
+ }
+ }
+ );
+}