From ffc6572bed699d09892fce8fe4e15a0f4cdd976f Mon Sep 17 00:00:00 2001 From: Jonathan Sundquist Date: Thu, 24 May 2018 09:40:10 -0500 Subject: [PATCH] Fixing the XHR bug where the json is assumed to be a string in IE --- admin/client/utils/List.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/client/utils/List.js b/admin/client/utils/List.js index 8926d0e6c3..731c0c8c2b 100644 --- a/admin/client/utils/List.js +++ b/admin/client/utils/List.js @@ -95,6 +95,7 @@ List.prototype.createItem = function (formData, callback) { xhr({ url: `${Keystone.adminPath}/api/${this.path}/create`, responseType: 'json', + json: true, method: 'POST', headers: assign({}, Keystone.csrf.header), body: formData, @@ -123,6 +124,7 @@ List.prototype.updateItem = function (id, formData, callback) { xhr({ url: `${Keystone.adminPath}/api/${this.path}/${id}`, responseType: 'json', + json: true, method: 'POST', headers: assign({}, Keystone.csrf.header), body: formData, @@ -232,6 +234,7 @@ List.prototype.loadItem = function (itemId, options, callback) { xhr({ url: url, responseType: 'json', + json: true, }, (err, resp, data) => { if (err) return callback(err); // Pass the data as result or error, depending on the statusCode @@ -255,6 +258,7 @@ List.prototype.loadItems = function (options, callback) { xhr({ url: url, responseType: 'json', + json: true, }, (err, resp, data) => { if (err) callback(err); // Pass the data as result or error, depending on the statusCode