fix: Update the error response during changing the password from profile settings (#9114)
This commit is contained in:
@@ -74,6 +74,7 @@
|
|||||||
import { required, minLength } from 'vuelidate/lib/validators';
|
import { required, minLength } from 'vuelidate/lib/validators';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
import alertMixin from 'shared/mixins/alertMixin';
|
||||||
|
import { parseAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [alertMixin],
|
mixins: [alertMixin],
|
||||||
@@ -125,10 +126,9 @@ export default {
|
|||||||
});
|
});
|
||||||
this.errorMessage = this.$t('PROFILE_SETTINGS.PASSWORD_UPDATE_SUCCESS');
|
this.errorMessage = this.$t('PROFILE_SETTINGS.PASSWORD_UPDATE_SUCCESS');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.errorMessage = this.$t('RESET_PASSWORD.API.ERROR_MESSAGE');
|
this.errorMessage =
|
||||||
if (error?.response?.data?.message) {
|
parseAPIErrorResponse(error) ||
|
||||||
this.errorMessage = error.response.data.message;
|
this.$t('RESET_PASSWORD.API.ERROR_MESSAGE');
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
this.isPasswordChanging = false;
|
this.isPasswordChanging = false;
|
||||||
this.showAlert(this.errorMessage);
|
this.showAlert(this.errorMessage);
|
||||||
|
|||||||
Reference in New Issue
Block a user