-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modification in StateTexas to pull all datasets #12
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Please avoid committing changes not relevant to the PR such as the package-lock.
@@ -27,6 +33,7 @@ export default ({ database, DataScraper }) => { | |||
}); | |||
}); | |||
|
|||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
|
||
for(let i = 0; i < Ids.length ; i++) /*The classic for loop does not requires a big polyfill*/ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polyfills aren't a concern here, it's being run on a controlled environment.
const collection = await collectionsRequest.json(); | ||
const resourcesRequest = await fetch(`${baseUrl}/${resources}`); | ||
const resource = await resourcesRequest.json(); | ||
const IdsRequest = await fetch(`${baseUrl}/collections_catalog/`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use pascal case, but camel case instead. Please be mindful about code styling used.
|
||
const [collectionsRequest, resourcesRequest] = await Promise.all([fetch(`${baseUrl}/${collections}`), fetch(`${baseUrl}/${resources}`)]); | ||
|
||
const [collection, resource] = await Promise.all([collectionsRequest.json(), resourcesRequest.json()]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to see the fetch/json parsing happen in series instead of parallel.
It was changed the State Texas to pull all datasets.
Now, first it fetchs all ids and the iterate over to pull all datasets.