vue3 infinite scroll
This commit is contained in:
@@ -5,7 +5,9 @@ export default defineStore('acctMgmtStore', {
|
||||
state: () => ({
|
||||
allUserAccoutList: [],
|
||||
isAcctMenuOpen: false,
|
||||
currentViewingUser: {}
|
||||
currentViewingUser: {
|
||||
detail: null,
|
||||
}
|
||||
}),
|
||||
getters: {
|
||||
},
|
||||
@@ -85,10 +87,24 @@ export default defineStore('acctMgmtStore', {
|
||||
|
||||
try{
|
||||
const response = await this.$axios.post(apiCreateAccount, userToCreate);
|
||||
console.log('TODO: response:', response, response.status);
|
||||
}
|
||||
catch(error) {
|
||||
apiError(error, 'Failed to add a new account');
|
||||
apiError(error, 'Failed to add a new account.');
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Get user detail by unique username.
|
||||
* @param {string} uniqueUsername
|
||||
*/
|
||||
async getUserDetail(uniqueUsername) {
|
||||
const apiUserDetail = `/api/users/${uniqueUsername}`;
|
||||
|
||||
try{
|
||||
const response = await this.$axios.get(apiUserDetail);
|
||||
this.currentViewingUser.detail = response.data;
|
||||
}
|
||||
catch(error) {
|
||||
apiError(error, 'Failed to get user detail.');
|
||||
};
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user