From bc97e000b8a94643ce86499dfdaed32b464fc8a6 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 14:41:44 -0300 Subject: [PATCH] Modify store user name when is modified in account config form --- src/pages/Account/AccountConfig.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/Account/AccountConfig.vue b/src/pages/Account/AccountConfig.vue index 7f1694ae..ebab7e47 100644 --- a/src/pages/Account/AccountConfig.vue +++ b/src/pages/Account/AccountConfig.vue @@ -15,6 +15,7 @@ const { t } = useI18n(); const jApi = inject('jApi'); const appStore = useAppStore(); const { isHeaderMounted } = storeToRefs(appStore); +const { user } = storeToRefs(userStore); const vnFormRef = ref(null); const vnFormRef2 = ref(null); @@ -43,6 +44,15 @@ const fetchLanguagesSql = async () => { } }; +const updateUserNickname = async nickname => { + try { + await vnFormRef.value.submit(); + user.value.nickname = nickname; + } catch (error) { + console.error(error); + } +}; + onMounted(() => fetchLanguagesSql()); @@ -90,8 +100,8 @@ onMounted(() => fetchLanguagesSql());