Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the XHR bug where the json is assumed to be a string in IE #4641

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/client/utils/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down