From 5d5730fc29732dafdffe88695c0e178187b8c925 Mon Sep 17 00:00:00 2001 From: Cindy Chang Date: Tue, 25 Jun 2024 12:53:50 +0800 Subject: [PATCH] visit API, is_admin badge API, is_active badge API, --- src/stores/acctMgmt.js | 10 +++-- .../AccountManagement/AccountAdmin/index.vue | 14 +++--- .../AccountManagement/ModalAccountInfo.vue | 45 +++++++++++-------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/src/stores/acctMgmt.js b/src/stores/acctMgmt.js index 407a0b4..c82ae20 100644 --- a/src/stores/acctMgmt.js +++ b/src/stores/acctMgmt.js @@ -6,7 +6,8 @@ export default defineStore('acctMgmtStore', { allUserAccoutList: [], isAcctMenuOpen: false, currentViewingUser: { - detail: null, + username: "", + detail: {}, }, response: { deleteAccount: null, @@ -58,7 +59,6 @@ export default defineStore('acctMgmtStore', { const response = await this.$axios.get(apiGetUserList); const customizedResponseData = await this.customizeAllUserList(response.data); this.allUserAccoutList = customizedResponseData; - console.log('getAllUserAccounts success'); } catch(error) { apiError(error, 'Failed to get all users.'); } @@ -110,7 +110,6 @@ export default defineStore('acctMgmtStore', { } } catch(error) { - console.log('error', error, error.status, error.code); apiError(error, 'Failed to delete the account.'); return false; }; @@ -124,7 +123,10 @@ export default defineStore('acctMgmtStore', { try{ const response = await this.$axios.get(apiUserDetail); - this.currentViewingUser.detail = response.data; + this.currentViewingUser = { + ...this.currentViewingUser, + detail: response.data, + } if(response.status === 200) { return true; } diff --git a/src/views/AccountManagement/AccountAdmin/index.vue b/src/views/AccountManagement/AccountAdmin/index.vue index c0ad7e4..4417d42 100644 --- a/src/views/AccountManagement/AccountAdmin/index.vue +++ b/src/views/AccountManagement/AccountAdmin/index.vue @@ -16,7 +16,7 @@