Skip to content

Commit

Permalink
Fix error from issue contentacms#51
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvangend authored Oct 30, 2019
1 parent 876e056 commit 23bad72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/jsonApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import qs from 'qs';

// Add a response interceptor to format response with jsonapi-parse
axios.interceptors.response.use(response => {
return jsonapiParse.parse(response.data).data;
const parsedResponse = jsonapiParse.parse(response.data);
if (parsedResponse === undefined) {
return response;
}
return parsedResponse.data;
});

export default {
Expand Down

0 comments on commit 23bad72

Please sign in to comment.