Skip to content

Commit 8ab1f95

Browse files
committed
Refactored code
1 parent 926a9c9 commit 8ab1f95

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

generator/templates/Authorisation/src/api/endpoints/authorisation/register.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ function acceptInvitation(email, token, password, passwordConfirmation) {
1818
});
1919
}
2020

21-
function resendInvitation(organisation, email) {
21+
function resendInvitation(email) {
2222
return post('invitation/resend', {
23-
organisation,
2423
email,
2524
});
2625
}

generator/templates/Authorisation/src/components/authorisation/PasswordResetCard.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<VCardTitle class="title" v-text="$t('authorisation.passwordReset.title')"/>
55
<v-card-text>
66
<v-alert
7-
:type="alertType"
7+
type="error"
88
:value="!!alertMessage.length"
99
class="mb-10"
1010
transition="fade-transition"
@@ -63,7 +63,6 @@ export default {
6363
},
6464
data() {
6565
return {
66-
alertType: 'success',
6766
alertMessage: '',
6867
isLoading: false,
6968
isValid: false,
@@ -85,15 +84,13 @@ export default {
8584
if (!this.isValid) return;
8685
8786
this.isLoading = true;
88-
this.alertType = 'error';
8987
this.errorMessage = '';
9088
9189
resetRequest(this.form.email, this.token, this.form.password, this.form.passwordConfirmation)
9290
.then(() => {
9391
this.$router.push({name: 'login', query: {message: 'passwordResetSuccess'}});
9492
})
9593
.catch((error) => {
96-
this.alertType = 'error';
9794
const { response } = error;
9895
const { status } = response;
9996

generator/templates/Authorisation/src/views/authorisation/InvitationAccept.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:value="!!alertMessage.length"
1010
class="mb-10"
1111
transition="fade-transition"
12-
:type="alertType"
12+
type="error"
1313
>
1414
{{ alertMessage }}
1515
<v-row class="mx-0 mt-3 justify-end">
@@ -74,15 +74,13 @@ export default {
7474
data() {
7575
return {
7676
errorCode: 0,
77-
alertType: 'success',
7877
alertMessage: '',
7978
isLoading: false,
8079
isValid: false,
8180
8281
email: this.$route.query.email,
8382
password: '',
8483
passwordConfirmation: '',
85-
organisation: this.$route.query.organisation,
8684
};
8785
},
8886
computed: {
@@ -108,17 +106,16 @@ export default {
108106
},
109107
methods: {
110108
async handleResend() {
111-
await resendInvitation(this.organisation, this.email);
109+
await resendInvitation(this.email);
112110
this.$router.push({name: 'login', query: {message: 'resendInvitationSuccess'}});
113111
},
114112
handleAccept() {
115113
this.isLoading = true;
116114
acceptInvitation(this.email, this.$route.params.token, this.password, this.passwordConfirmation)
117115
.then(() => {
118-
this.$router.push({name: 'login', query: {message: 'invitationAcceptSuccess'}});
116+
this.$router.push({name: 'login', query: {message: 'acceptInvitationSuccess'}});
119117
})
120118
.catch((error) => {
121-
this.alertType = 'error';
122119
const { response } = error;
123120
const { status } = response;
124121

generator/templates/Authorisation/src/views/authorisation/RegistrationVerify.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<VCardTitle class="title" v-text="$t('authorisation.registrationVerify.title')"/>
77
<v-card-text>
88
<v-alert
9-
:type="alertType"
9+
type="error"
1010
:value="!!alertMessage.length"
1111
text
1212
transition="fade-transition"
@@ -67,7 +67,6 @@ export default {
6767
email: '',
6868
},
6969
isLoading: false,
70-
alertType: 'success',
7170
alertMessage: '',
7271
valid: true,
7372
showPassword: false,
@@ -92,7 +91,6 @@ export default {
9291
const { response } = error;
9392
const { status } = response;
9493
95-
this.alertType = 'error';
9694
if (status === 429) {
9795
this.alertMessage = this.$t('errors.429', { minutes: getRateLimitMinutes(response) });
9896
} else if (status === 400) {

0 commit comments

Comments
 (0)