diff options
Diffstat (limited to 'webapp/actions')
-rw-r--r-- | webapp/actions/channel_actions.jsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx index 340f90fc4..4b4e3e10c 100644 --- a/webapp/actions/channel_actions.jsx +++ b/webapp/actions/channel_actions.jsx @@ -461,3 +461,23 @@ export function leaveChannel(channelId, success, error) { } ); } + +export function deleteChannel(channelId, success, error) { + Client.deleteChannel( + channelId, + () => { + loadChannelsForCurrentUser(); + + if (success) { + success(); + } + }, + (err) => { + AsyncClient.dispatchError(err, 'handleDelete'); + + if (error) { + error(err); + } + } + ); +} |