Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davifs92
Copy link

@davifs92 davifs92 commented Feb 8, 2023

It was changed the State Texas to pull all datasets.

Now, first it fetchs all ids and the iterate over to pull all datasets.

Copy link
Contributor

@Nefsen402 Nefsen402 left a 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 }) => {
});
});

}
Copy link
Contributor

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*/ {
Copy link
Contributor

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/`);
Copy link
Contributor

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()]);
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants