diff options
author | dartcafe <github@dartcafe.de> | 2020-12-05 23:48:10 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-12-05 23:48:10 +0300 |
commit | 326efd276a6b543ad24b8e5591def3262d22d47f (patch) | |
tree | 90c39a0eb54bce6904579741a3a652ec643b363b /src/js/components/Base | |
parent | bf0081da09828db80da3b716ca274e3313241aa4 (diff) |
fixing registration and resending invitation mail
Diffstat (limited to 'src/js/components/Base')
-rw-r--r-- | src/js/components/Base/PersonalLink.vue | 17 | ||||
-rw-r--r-- | src/js/components/Base/PublicRegisterModal.vue | 2 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/js/components/Base/PersonalLink.vue b/src/js/components/Base/PersonalLink.vue index bd44d7c7..1e1668bc 100644 --- a/src/js/components/Base/PersonalLink.vue +++ b/src/js/components/Base/PersonalLink.vue @@ -31,7 +31,7 @@ <ButtonDiv v-if="share.emailAddress" icon="icon-mail" :title="t('polls','Resend invitation mail to {emailAdress}', { emailAdress: share.emailAddress })" - @click="sendInvitation()" /> + @click="resendInvitation()" /> </div> </template> @@ -63,16 +63,13 @@ export default { }, methods: { - sendInvitation() { - this.$store.dispatch('poll/share/sendInvitation') + resendInvitation() { + this.$store.dispatch('poll/share/resendInvitation') .then((response) => { - response.data.sentResult.sentMails.forEach((item) => { - showSuccess(t('polls', 'Invitation sent to {emailAddress}', { emailAddress: item.eMailAddress })) - }) - response.data.sentResult.abortedMails.forEach((item) => { - console.error('Mail could not be sent!', { recipient: item }) - showError(t('polls', 'Error sending invitation to {emailAddress}', { emailAddress: item.eMailAddress })) - }) + showSuccess(t('polls', 'Invitation resent to {emailAddress}', { emailAddress: response.data.share.emailAddress })) + }) + .catch(() => { + showError(t('polls', 'Mail could not be resent to {emailAddress}', { emailAddress: this.share.emailAddress })) }) }, diff --git a/src/js/components/Base/PublicRegisterModal.vue b/src/js/components/Base/PublicRegisterModal.vue index 9e506494..6100aa86 100644 --- a/src/js/components/Base/PublicRegisterModal.vue +++ b/src/js/components/Base/PublicRegisterModal.vue @@ -251,7 +251,7 @@ export default { submitRegistration() { if (this.isValidName && (this.isValidEmailAddress || this.emailAddress.length === 0)) { - this.$store.dispatch('poll/shares/addPersonal', { token: this.$route.params.token, userName: this.userName, emailAddress: this.emailAddress }) + this.$store.dispatch('poll/share/register', { userName: this.userName, emailAddress: this.emailAddress }) .then((response) => { if (this.$route.params.token === response.token) { this.$store.dispatch({ type: 'poll/get', pollId: this.$route.params.id, token: this.$route.params.token }) |