Skip to content

Commit

Permalink
chore(deps): bump axios from 0.21.3 to 0.28.0 (#3894)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Oct 3, 2024
1 parent 6df7b19 commit 6dfc11a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
17 changes: 12 additions & 5 deletions shared-helpers/src/auth/catchNetworkError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ export type NetworkStatusType = AlertTypes

export type NetworkStatusError = AxiosError

type CatchNetworkError = {
failureCountRemaining?: number
message?: string
}

export type NetworkStatusContent = {
title: string
description: string
error?: AxiosError
error?: AxiosError<CatchNetworkError>
} | null

export type NetworkErrorDetermineError = (
Expand All @@ -38,7 +43,7 @@ export enum NetworkErrorMessage {
export const useCatchNetworkError = () => {
const [networkError, setNetworkError] = useState<NetworkStatusContent>(null)

const check401Error = (message: string, error: AxiosError) => {
const check401Error = (message: string, error: AxiosError<CatchNetworkError>) => {
if (message?.includes(NetworkErrorMessage.PasswordOutdated)) {
setNetworkError({
title: t("authentication.signIn.passwordOutdated"),
Expand Down Expand Up @@ -74,9 +79,11 @@ export const useCatchNetworkError = () => {
}
}

const determineNetworkError: NetworkErrorDetermineError = (status, error) => {
const responseMessage = axios.isAxiosError(error) ? error.response?.data.message : ""

const determineNetworkError: NetworkErrorDetermineError = (
status,
error: AxiosError<CatchNetworkError>
) => {
const responseMessage = axios.isAxiosError(error) ? error.response?.data.message || "" : ""
switch (status) {
case 401:
check401Error(responseMessage, error)
Expand Down
2 changes: 1 addition & 1 deletion sites/partners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@mapbox/mapbox-sdk": "^0.13.0",
"ag-grid-community": "^26.0.0",
"ag-grid-react": "^26.0.0",
"axios": "^0.21.1",
"axios": "^0.28.0",
"axios-cookiejar-support": "4.0.6",
"dayjs": "^1.10.7",
"dotenv": "^8.2.0",
Expand Down
2 changes: 1 addition & 1 deletion sites/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@heroicons/react": "^2.1.1",
"@sentry/nextjs": "^7.61.0",
"autoprefixer": "^10.3.4",
"axios": "^0.21.1",
"axios": "^0.28.0",
"axios-cookiejar-support": "4.0.6",
"dayjs": "^1.10.7",
"deasync": "0.1.28",
Expand Down
29 changes: 20 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4841,12 +4841,14 @@ axios@^0.19.2:
dependencies:
follow-redirects "1.5.10"

axios@^0.21.1:
version "0.21.4"
resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
axios@^0.28.0:
version "0.28.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.28.0.tgz#801a4d991d0404961bccef46800e1170f8278c89"
integrity sha512-Tu7NYoGY4Yoc7I+Npf9HhUMtEEpV7ZiLH9yndTCoNhcpBH0kwcvFbzYN9/u5QKI5A6uefjsNNWaz5olJVYS62Q==
dependencies:
follow-redirects "^1.14.0"
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axobject-query@^2.2.0:
version "2.2.0"
Expand Down Expand Up @@ -7626,10 +7628,10 @@ follow-redirects@1.5.10:
dependencies:
debug "=3.1.0"

follow-redirects@^1.14.0, follow-redirects@^1.15.2:
version "1.15.2"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz"
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
follow-redirects@^1.14.0, follow-redirects@^1.15.0, follow-redirects@^1.15.2:
version "1.15.9"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1"
integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==

for-each@^0.3.3:
version "0.3.3"
Expand Down Expand Up @@ -7665,6 +7667,15 @@ form-data@^3.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz"
Expand Down

0 comments on commit 6dfc11a

Please sign in to comment.