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

SCANNPM-2 Use axios instance to re-use fetching logic #120

Conversation

7PH
Copy link
Member

@7PH 7PH commented Apr 22, 2024

  • Calls to fetch have been modified from
      const response = await fetch(token, {
        url: ...,
        ...getHttpAgents(proxyUrl),
      });
      // to
      const response = await fetch({
        url: ...,
      });
  • An initial call to initializeAxios(properties) was added to the top of scan.ts
  • Added unit tests for the init/fetch logic
  • Moved http-agent.ts code to request.ts
  • Used params: { .. } to pass GET params to urls

@7PH 7PH changed the title SCANNPM-2 Refactor fetch(..) to take properties object rather than token SCANNPM-2 Use axios instance to re-use fetching logic Apr 22, 2024
@7PH 7PH force-pushed the feature/br/scannpm-18-use-axios-instance-to-re-use-fetching-logic branch 3 times, most recently from fc99718 to abe0633 Compare April 22, 2024 14:19
src/http-agent.ts Outdated Show resolved Hide resolved
@7PH 7PH force-pushed the feature/br/scannpm-18-use-axios-instance-to-re-use-fetching-logic branch 3 times, most recently from 7882e09 to 29b035f Compare April 22, 2024 15:22
@7PH 7PH force-pushed the feature/br/scannpm-18-use-axios-instance-to-re-use-fetching-logic branch from 29b035f to b89ad27 Compare April 22, 2024 15:27
@lucas-paulger-sonarsource

I would push to merge this first so we can address it in the respective PRs now. wdyt?

@7PH 7PH force-pushed the feature/br/scannpm-18-use-axios-instance-to-re-use-fetching-logic branch from b89ad27 to 3338e1e Compare April 23, 2024 07:21
Copy link

@lucas-paulger-sonarsource lucas-paulger-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful 💯

@lucas-paulger-sonarsource lucas-paulger-sonarsource merged commit 6bad249 into feature/MMF-3712 Apr 23, 2024
0 of 4 checks passed
@lucas-paulger-sonarsource lucas-paulger-sonarsource deleted the feature/br/scannpm-18-use-axios-instance-to-re-use-fetching-logic branch April 23, 2024 11:13
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.

None yet

2 participants