visit API, is_admin badge API, is_active badge API,

This commit is contained in:
Cindy Chang
2024-06-25 12:53:50 +08:00
parent 6d11849dae
commit 5d5730fc29
3 changed files with 40 additions and 29 deletions

View File

@@ -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;
}