Skip to content

Commit

Permalink
fix: Sove very annoying axios bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
NunoSempere committed Jan 20, 2023
1 parent c1c939b commit e6c0167
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -50,7 +50,7 @@
"ajv": "^8.11.0",
"algoliasearch": "^4.14.2",
"autoprefixer": "10.4.5",
"axios": "^1.2.0",
"axios": "^1.2.1",
"chroma-js": "^2.4.2",
"critters": "^0.0.16",
"date-fns": "^2.29.3",
Expand Down
4 changes: 3 additions & 1 deletion src/backend/platforms/manifold.ts
Expand Up @@ -16,8 +16,9 @@ async function fetchPage(endpoint: string) {
url: endpoint,
method: "GET",
headers: {
"Content-Type": "text/html",
"Content-Type": "text/json",
},
'accept-encoding': 'application/json'
}).then((response) => response.data);
// console.log(response)
return response;
Expand All @@ -31,6 +32,7 @@ async function fetchAllData(){
while(!end){
console.log(`Query #${counter}: ${endpoint}`)
let newData = await fetchPage(endpoint)
// console.log(newData)
if(Array.isArray(newData)){
allData.push(...newData)
let hasReachedEnd = (newData.length == 0) || (newData[newData.length -1] == undefined) || (newData[newData.length -1].id == undefined)
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -2856,10 +2856,10 @@ axios@^0.21.4:
dependencies:
follow-redirects "^1.14.0"

axios@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.0.tgz#1cb65bd75162c70e9f8d118a905126c4a201d383"
integrity sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw==
axios@^1.2.1:
version "1.2.3"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.3.tgz#31a3d824c0ebf754a004b585e5f04a5f87e6c4ff"
integrity sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==
dependencies:
follow-redirects "^1.15.0"
form-data "^4.0.0"
Expand Down

0 comments on commit e6c0167

Please sign in to comment.