diff --git a/app/soapbox/actions/me.js b/app/soapbox/actions/me.js index e04001e4ca..b948111349 100644 Binary files a/app/soapbox/actions/me.js and b/app/soapbox/actions/me.js differ diff --git a/app/soapbox/features/edit_profile/index.tsx b/app/soapbox/features/edit_profile/index.tsx index bcde7c73e7..595b440b0e 100644 --- a/app/soapbox/features/edit_profile/index.tsx +++ b/app/soapbox/features/edit_profile/index.tsx @@ -169,7 +169,7 @@ const EditProfile: React.FC = () => { }; const handleSubmit: React.FormEventHandler = (event) => { - const credentials = dispatch(patchMe(data)); + const credentials = dispatch(patchMe(data, true)); /* Bad API url, was causing errors in the promise call below blocking the success message after making edits. */ /* const notifications = dispatch(updateNotificationSettings({ block_from_strangers: this.state.stranger_notifications || false, diff --git a/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx b/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx index ccc000816d..27d3d842d6 100644 --- a/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx +++ b/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx @@ -61,7 +61,7 @@ const AvatarSelectionStep = ({ onNext }: { onNext: () => void }) => { setSelectedFile(null); if (error.response?.status === 422) { - dispatch(snackbar.error(error.response.data.error.replace('Validation failed: ', ''))); + dispatch(snackbar.error((error.response.data as any).error.replace('Validation failed: ', ''))); } else { dispatch(snackbar.error('An unexpected error occurred. Please try again or skip this step.')); } diff --git a/app/soapbox/features/onboarding/steps/bio-step.tsx b/app/soapbox/features/onboarding/steps/bio-step.tsx index d7c8a669de..6b80d75bb7 100644 --- a/app/soapbox/features/onboarding/steps/bio-step.tsx +++ b/app/soapbox/features/onboarding/steps/bio-step.tsx @@ -33,7 +33,7 @@ const BioStep = ({ onNext }: { onNext: () => void }) => { setSubmitting(false); if (error.response?.status === 422) { - setErrors([error.response.data.error.replace('Validation failed: ', '')]); + setErrors([(error.response.data as any).error.replace('Validation failed: ', '')]); } else { dispatch(snackbar.error('An unexpected error occurred. Please try again or skip this step.')); } diff --git a/app/soapbox/features/onboarding/steps/cover-photo-selection-step.tsx b/app/soapbox/features/onboarding/steps/cover-photo-selection-step.tsx index 1652244692..29b333a521 100644 --- a/app/soapbox/features/onboarding/steps/cover-photo-selection-step.tsx +++ b/app/soapbox/features/onboarding/steps/cover-photo-selection-step.tsx @@ -62,7 +62,7 @@ const CoverPhotoSelectionStep = ({ onNext }: { onNext: () => void }) => { setSelectedFile(null); if (error.response?.status === 422) { - dispatch(snackbar.error(error.response.data.error.replace('Validation failed: ', ''))); + dispatch(snackbar.error((error.response.data as any).error.replace('Validation failed: ', ''))); } else { dispatch(snackbar.error('An unexpected error occurred. Please try again or skip this step.')); } diff --git a/app/soapbox/features/onboarding/steps/display-name-step.tsx b/app/soapbox/features/onboarding/steps/display-name-step.tsx index d489158ce7..f54fa21c96 100644 --- a/app/soapbox/features/onboarding/steps/display-name-step.tsx +++ b/app/soapbox/features/onboarding/steps/display-name-step.tsx @@ -40,7 +40,7 @@ const DisplayNameStep = ({ onNext }: { onNext: () => void }) => { setSubmitting(false); if (error.response?.status === 422) { - setErrors([error.response.data.error.replace('Validation failed: ', '')]); + setErrors([(error.response.data as any).error.replace('Validation failed: ', '')]); } else { dispatch(snackbar.error('An unexpected error occurred. Please try again or skip this step.')); } diff --git a/app/soapbox/features/public_layout/components/header.tsx b/app/soapbox/features/public_layout/components/header.tsx index e6528cbb44..c10eaea4e7 100644 --- a/app/soapbox/features/public_layout/components/header.tsx +++ b/app/soapbox/features/public_layout/components/header.tsx @@ -57,7 +57,7 @@ const Header = () => { .catch((error: AxiosError) => { setLoading(false); - const data = error.response?.data; + const data: any = error.response?.data; if (data?.error === 'mfa_required') { setMfaToken(data.mfa_token); } diff --git a/package.json b/package.json index 28f4678910..681c34e553 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "@types/uuid": "^8.3.4", "array-includes": "^3.0.3", "autoprefixer": "^10.4.2", - "axios": "^0.21.4", + "axios": "^0.27.2", "axios-mock-adapter": "^1.18.1", "babel-loader": "^8.2.2", "babel-plugin-lodash": "^3.3.4", diff --git a/yarn.lock b/yarn.lock index a5e5160fed..39d12627f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2906,12 +2906,13 @@ axios-mock-adapter@^1.18.1: is-blob "^2.1.0" is-buffer "^2.0.5" -axios@^0.21.4: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== +axios@^0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== dependencies: - follow-redirects "^1.14.0" + follow-redirects "^1.14.9" + form-data "^4.0.0" axobject-query@^2.2.0: version "2.2.0" @@ -5106,11 +5107,16 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -follow-redirects@^1.0.0, follow-redirects@^1.14.0: +follow-redirects@^1.0.0: version "1.14.4" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379" integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== +follow-redirects@^1.14.9: + version "1.14.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" + integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== + foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -5144,6 +5150,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" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"