|
@@ -112,11 +112,21 @@ function initCommands() {
|
112
|
112
|
const { name } = request;
|
113
|
113
|
|
114
|
114
|
switch (name) {
|
115
|
|
- case 'invite':
|
|
115
|
+ case 'invite': // eslint-disable-line no-case-declarations
|
|
116
|
+ const { invitees } = request;
|
|
117
|
+
|
|
118
|
+ if (!Array.isArray(invitees) || invitees.length === 0) {
|
|
119
|
+ callback({
|
|
120
|
+ error: new Error('Unexpected format of invitees')
|
|
121
|
+ });
|
|
122
|
+
|
|
123
|
+ break;
|
|
124
|
+ }
|
|
125
|
+
|
116
|
126
|
// The store should be already available because API.init is called
|
117
|
127
|
// on appWillMount action.
|
118
|
128
|
APP.store.dispatch(
|
119
|
|
- invite(request.invitees, true))
|
|
129
|
+ invite(invitees, true))
|
120
|
130
|
.then(failedInvitees => {
|
121
|
131
|
let error;
|
122
|
132
|
let result;
|