Skip to content

Commit

Permalink
Merge pull request #80 from webitel/hotfix/back-in-prev-step-when-error
Browse files Browse the repository at this point in the history
hotfix: change error code and condition return to previous step[WTEL-…
  • Loading branch information
Lera24 authored May 23, 2024
2 parents 2e0aa6e + 4f2644d commit 78e0214
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/auth/login/the-login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ export default {
watch: {
isBackPrevStep: {
handler(value) {
if(value && this.activeStep === 3) this.backPrevStep();
if(value && this.activeStep === 3)
this.backPrevStep();
this.$emit('change-is-back-prev-step');
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/auth/the-auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:is-back-prev-step="isBackPrevStepInLogin"
@change-tab="currentTab = $event"
@submit="authorization(currentTab.value)"
@change-is-back-prev-step="changeIsBackPrevStepInLogin"
/>
</div>
</section>
Expand Down Expand Up @@ -119,8 +120,11 @@ export default {
try {
await this.submitAuth(tab)
} catch (err) {
if(tab === 'login' && err.code === 400) this.isBackPrevStepInLogin = true;
if(tab === 'login' && err.code === 419) this.isBackPrevStepInLogin = true;
}
},
changeIsBackPrevStepInLogin() {
this.isBackPrevStepInLogin = false;
}
},
created() {
Expand Down

0 comments on commit 78e0214

Please sign in to comment.