Skip to content

Commit

Permalink
[sonata-project#6569] Parse JSON responses on Admin.setup_xeditable()
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Feb 15, 2021
1 parent 2127a5d commit b7e5746
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Resources/public/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ var Admin = {
.replaceWith(html);
},
error: function(xhr, statusText, errorThrown) {
// On some error responses, we return JSON.
if ('application/json' === xhr.getResponseHeader('Content-Type')) {
return JSON.parse(xhr.responseText);
}

return xhr.responseText;
}
});
Expand Down

0 comments on commit b7e5746

Please sign in to comment.