Commit 7c823ca4 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'tz-improved-readme-loading' into 'master'

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

See merge request gitlab-org/gitlab!35147
parents 778a38de 0b0c6802
......@@ -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