-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
[TECH] Upgrade Axios to latest #3917
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.
Other than the one type issue, LGTM. Might want to wait until after the release is done to merge this though
@@ -869,7 +871,7 @@ export async function getBuilds( | |||
url.searchParams.set('password', password) | |||
} | |||
|
|||
const headers: AxiosRequestHeaders = {} | |||
const headers = {} as AxiosRequestHeaders |
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.
This type assertion is incorrect. Most of the time, if you add as T
because TS is yelling at you, you're doing something wrong. In this case, {}
can't be of type AxiosHeaders (AxiosHeaders is a class with a few methods, which an empty object of course doesn't have)
Axios also accepts a standard Record
for headers, which is fine to use here:
const headers = {} as AxiosRequestHeaders | |
const headers: Record<string, string> = {} |
@@ -1265,7 +1267,7 @@ export async function getProductApi( | |||
url.searchParams.set('expand', expand.join(',')) | |||
} | |||
|
|||
const headers: AxiosRequestHeaders = {} | |||
const headers = {} as AxiosRequestHeaders |
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.
Same issue as above here
Upgrade Axios to latest version and also fix the necessary types and imports
Use the following Checklist if you have changed something on the Backend or Frontend: