summaryrefslogtreecommitdiffstats
path: root/webapp/actions/channel_actions.jsx
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2017-01-19 14:40:21 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-01-19 08:40:21 -0500
commit61b7226533568f3261fc233538ce998bb71a5345 (patch)
tree7068a3ce9fc9dc7bfa272112dff55ff301d84330 /webapp/actions/channel_actions.jsx
parent24553164b6166e01ed27a5c5de476d73c6369461 (diff)
downloadchat-61b7226533568f3261fc233538ce998bb71a5345.tar.gz
chat-61b7226533568f3261fc233538ce998bb71a5345.tar.bz2
chat-61b7226533568f3261fc233538ce998bb71a5345.zip
Move instances of Client.updateChannelPurpose() in components to an action (#5096)
Diffstat (limited to 'webapp/actions/channel_actions.jsx')
-rw-r--r--webapp/actions/channel_actions.jsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index 3e41a2310..c9c04d462 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -364,6 +364,25 @@ export function createChannel(channel, success, error) {
);
}
+export function updateChannelPurpose(channelId, purposeValue, success, error) {
+ Client.updateChannelPurpose(
+ channelId,
+ purposeValue,
+ () => {
+ AsyncClient.getChannel(channelId);
+
+ if (success) {
+ success();
+ }
+ },
+ (err) => {
+ if (error) {
+ error(err);
+ }
+ }
+ );
+}
+
export function updateChannelHeader(channelId, header, success, error) {
Client.updateChannelHeader(
channelId,