From 9e9500e9e7cdfa5254b6f854edc03a965aa65aee Mon Sep 17 00:00:00 2001 From: yingfeng Date: Mon, 1 Jul 2024 12:04:41 -0400 Subject: [PATCH] AMP-3079: fix bug in activation msg --- src/components/account/Login.vue | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/account/Login.vue b/src/components/account/Login.vue index 3ffe030..6383851 100644 --- a/src/components/account/Login.vue +++ b/src/components/account/Login.vue @@ -124,24 +124,24 @@ export default { this.loading = true; await this.activateNewUser(); this.loading = false; - console.log("activation result is:" + this.activate_status); + console.log("activation status:" + this.activate_status); + console.log("activation errors:" + this.errors.other_errors); } }, methods: { - activateNewUser() { + async activateNewUser() { let self = this; - accountService - .sendActivateUserRequest(this.token) - .then((response) => { - self.activate_status = response.success; - if (self.activate_status) - self.errors.other_errors = "Your account has been successfully activated. You may now login."; - else - self.errors.other_errors = response.errors; - }) - .catch((e) => { + try { + let response = await accountService.sendActivateUserRequest(this.token); + self.activate_status = response.success; + if (self.activate_status) + self.errors.other_errors[0] = "Your account has been successfully activated. You may now login."; + else + self.errors.other_errors = response.errors; + } + catch(e) { console.log(e); - }); + } }, async checkForm() { event.preventDefault();