-
Notifications
You must be signed in to change notification settings - Fork 7
add axios and default timeout to api #1968
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
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.
Pull Request Overview
This PR replaces the existing fetch-based HTTP client with Axios (including a default timeout) and adjusts class formatting in one API file.
- Swapped out
fetchcalls foraxios.get/axios.postwith a 5 s default timeout inHttpClientBase.ts - Removed the old JSON
responseHandlerand streamlined error handling - Updated brace placement for the
ProviderApiclass declaration
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/api/src/api/ProviderApi.ts | Moved the class’s opening { inline with the implements clause for consistency |
| packages/api/src/api/HttpClientBase.ts | Replaced fetch with Axios, added default timeout and JSON header, removed handler |
Comments suppressed due to low confidence (1)
packages/api/src/api/HttpClientBase.ts:24
- [nitpick] The new Axios-based
fetchmethod and its default timeout behavior aren't covered by existing tests. Adding unit tests for successful responses, timeout scenarios, and error handling will help prevent regressions.
protected async fetch<T>(input: RequestInfo, config: AxiosRequestConfig = {}): Promise<T> {
|
@HughParry is wary of axios, apparently past portal issues? |
|
Needs testing! This adds helpers to base lvl http client so should be more tested across all services before it's ready for review |
c3bc3c5 to
b9f10d3
Compare
54770eb to
45d558f
Compare
No description provided.