Files
mattermost-mobile/app/actions/views/channel_add_members.js
2018-06-19 19:14:50 -04:00

17 lines
522 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {addChannelMember} from 'mattermost-redux/actions/channels';
export function handleAddChannelMembers(channelId, members) {
return async (dispatch, getState) => {
try {
const requests = members.map((m) => dispatch(addChannelMember(channelId, m, getState)));
return await Promise.all(requests);
} catch (error) {
return error;
}
};
}