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 => { ...@@ -27,17 +27,22 @@ const setupAxiosStartupCalls = axios => {
if (existing) { if (existing) {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
req.adapter = () => 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 // eslint-disable-next-line promise/no-nesting
res.json().then(data => ({ return res.json().then(data => ({
data, data,
status: res.status, status: res.status,
statusText: res.statusText, statusText: res.statusText,
headers: res.headers, headers: fetchHeaders,
config: req, config: req,
request: req, request: req,
})), }));
); });
} }
return req; return req;
......
...@@ -30,7 +30,7 @@ const defaultClient = createDefaultClient( ...@@ -30,7 +30,7 @@ const defaultClient = createDefaultClient(
}, },
readme(_, { url }) { readme(_, { url }) {
return axios return axios
.get(url, { params: { viewer: 'rich', format: 'json' } }) .get(url, { params: { format: 'json', viewer: 'rich' } })
.then(({ data }) => ({ ...data, __typename: 'ReadmeFile' })); .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