Explorar el Código

invite post to use application/JSON

changed to .ajax from .post to allow content type to be set
master
Aaron van Meerten hace 6 años
padre
commit
76638f524d
Se han modificado 1 ficheros con 14 adiciones y 9 borrados
  1. 14
    9
      react/features/invite/functions.js

+ 14
- 9
react/features/invite/functions.js Ver fichero

@@ -275,15 +275,20 @@ export function invitePeopleAndChatRooms( // eslint-disable-line max-params
275 275
     }
276 276
 
277 277
     return new Promise((resolve, reject) => {
278
-        $.post(
279
-                `${inviteServiceUrl}?token=${jwt}`,
280
-                JSON.stringify({
281
-                    'invited': inviteItems,
282
-                    'url': inviteUrl
283
-                }),
284
-                resolve,
285
-                'json')
286
-            .fail((jqxhr, textStatus, error) => reject(error));
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
+        });
287 292
     });
288 293
 }
289 294
 

Loading…
Cancelar
Guardar