Commit 0b0c6802 authored by Tim Zallmann's avatar Tim Zallmann

Fix for Readme startup query and Conversion of fetch headers to axios

Removed console.log
parent 894fe92a
......@@ -27,17 +27,22 @@ const setupAxiosStartupCalls = axios => {
if (existing) {
// eslint-disable-next-line no-param-reassign
req.adapter = () =>
existing.fetchCall.then(res =>
existing.fetchCall.then(res => {
const fetchHeaders = {};
res.headers.forEach((val, key) => {
fetchHeaders[key] = val;
});
// eslint-disable-next-line promise/no-nesting
res.json().then(data => ({
return res.json().then(data => ({
data,
status: res.status,
statusText: res.statusText,
headers: res.headers,
headers: fetchHeaders,
config: req,
request: req,
})),
);
}));
});
}
return req;
......
......@@ -30,7 +30,7 @@ const defaultClient = createDefaultClient(
},
readme(_, { url }) {
return axios
.get(url, { params: { viewer: 'rich', format: 'json' } })
.get(url, { params: { format: 'json', viewer: 'rich' } })
.then(({ data }) => ({ ...data, __typename: 'ReadmeFile' }));
},
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment