mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Move instances of Client.deleteChannel() in components to an action (#5164)
This commit is contained in:
committed by
Joram Wilander
parent
a8f35c5738
commit
dbfd93daa7
@@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user