From c4d31394ec6b781d50689572f00c92ea177da9bc Mon Sep 17 00:00:00 2001 From: Florent <flavelle@neogeo.fr> Date: Tue, 4 Feb 2025 16:17:23 +0100 Subject: [PATCH] minor change --- src/views/UserProfile.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/views/UserProfile.vue b/src/views/UserProfile.vue index a68a6a4..a0aca62 100644 --- a/src/views/UserProfile.vue +++ b/src/views/UserProfile.vue @@ -839,14 +839,14 @@ export default { }); }, - submitNewPassword() { - const data = { - password: this.formPassword.password, - new_password: this.formPassword.newPassword2 - }; - this.loadingUserPassword = true; - this.UPDATE_USER_DETAIL(data) - .then(() => { + async submitNewPassword() { + try { + this.loadingUserPassword = true; + const data = { + password: this.formPassword.password, + new_password: this.formPassword.newPassword2 + }; + await this.UPDATE_USER_DETAIL(data); this.loadingUserPassword = false; if (this.success && this.success.length) { Swal.fire({ @@ -865,7 +865,10 @@ export default { } }); } - }); + } catch (err) { + console.error(err); + this.loadingUserPassword = false; + } } } -- GitLab