浏览代码

use fetch syntax from virtuacoplenny

j8
Aaron van Meerten 6 年前
父节点
当前提交
1a5e2763c1
共有 1 个文件被更改,包括 13 次插入16 次删除
  1. 13
    16
      react/features/invite/functions.js

+ 13
- 16
react/features/invite/functions.js 查看文件

@@ -274,22 +274,19 @@ export function invitePeopleAndChatRooms( // eslint-disable-line max-params
274 274
         return Promise.resolve();
275 275
     }
276 276
 
277
-    return new Promise((resolve, reject) => {
278
-        $.ajax({
279
-            url: `${inviteServiceUrl}?token=${jwt}`,
280
-            data: JSON.stringify({
281
-                'invited': inviteItems,
282
-                'url': inviteUrl
283
-            }),
284
-            dataType: 'json',
285
-            contentType: 'application/json', // send as JSON
286
-            success: resolve, // called when success is reached
287
-            // called when there is an error
288
-            error: (jqxhr, textStatus, error) => {
289
-                reject(error);
290
-            }
291
-        });
292
-    });
277
+    return fetch(
278
+           `${inviteServiceUrl}?token=${jwt}`,
279
+           {
280
+               body: JSON.stringify({
281
+                   'invited': inviteItems,
282
+                   'url': inviteUrl
283
+               }),
284
+               method: 'POST',
285
+               headers: {
286
+                   'Content-Type': 'application/json'
287
+               }
288
+           }
289
+    );
293 290
 }
294 291
 
295 292
 /**

正在加载...
取消
保存