Skip to content

Commit 23bad72

Browse files
authored
Fix error from issue contentacms#51
1 parent 876e056 commit 23bad72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/jsonApiClient.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import qs from 'qs';
99

1010
// Add a response interceptor to format response with jsonapi-parse
1111
axios.interceptors.response.use(response => {
12-
return jsonapiParse.parse(response.data).data;
12+
const parsedResponse = jsonapiParse.parse(response.data);
13+
if (parsedResponse === undefined) {
14+
return response;
15+
}
16+
return parsedResponse.data;
1317
});
1418

1519
export default {

0 commit comments

Comments
 (0)