Rename allUserAccoutList to allUserAccountList (fix typo)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ interface EditDetail {
|
||||
export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
persist: true,
|
||||
state: () => ({
|
||||
allUserAccoutList: [] as User[],
|
||||
allUserAccountList: [] as User[],
|
||||
isAcctMenuOpen: false,
|
||||
currentViewingUser: {
|
||||
username: '',
|
||||
@@ -74,7 +74,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
* @param {string} username
|
||||
*/
|
||||
setCurrentViewingUser(username: string) {
|
||||
const userFind = this.allUserAccoutList.find(user => user.username === username);
|
||||
const userFind = this.allUserAccountList.find(user => user.username === username);
|
||||
this.currentViewingUser = userFind;
|
||||
},
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
try {
|
||||
const response = await apiClient.get(apiGetUserList);
|
||||
const customizedResponseData = await this.customizeAllUserList(response.data);
|
||||
this.allUserAccoutList = await this.moveCurrentLoginUserToFirstRow(customizedResponseData);
|
||||
this.allUserAccountList = await this.moveCurrentLoginUserToFirstRow(customizedResponseData);
|
||||
} catch (error) {
|
||||
apiError(error, 'Failed to get all users.');
|
||||
}
|
||||
@@ -278,7 +278,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
* @param {boolean} isDeleteHovered
|
||||
*/
|
||||
changeIsDeleteHoveredByUser(username: string, isDeleteHovered: boolean) {
|
||||
const userToChange = this.allUserAccoutList.find(user => user.username === username);
|
||||
const userToChange = this.allUserAccountList.find(user => user.username === username);
|
||||
if (userToChange) {
|
||||
userToChange.isDeleteHovered = isDeleteHovered;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
* @param {boolean} isRowHovered
|
||||
*/
|
||||
changeIsRowHoveredByUser(username: string, isRowHovered: boolean) {
|
||||
const userToChange = this.allUserAccoutList.find(user => user.username === username);
|
||||
const userToChange = this.allUserAccountList.find(user => user.username === username);
|
||||
if (userToChange) {
|
||||
userToChange.isRowHovered = isRowHovered;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
* @param {boolean} isEditHovered
|
||||
*/
|
||||
changeIsEditHoveredByUser(username: string, isEditHovered: boolean) {
|
||||
const userToChange = this.allUserAccoutList.find(user => user.username === username);
|
||||
const userToChange = this.allUserAccountList.find(user => user.username === username);
|
||||
if (userToChange) {
|
||||
userToChange.isEditHovered = isEditHovered;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
* @param {boolean} isEditHovered
|
||||
*/
|
||||
changeIsDetailHoveredByUser(username: string, isDetailHovered: boolean) {
|
||||
const userToChange = this.allUserAccoutList.find(user => user.username === username);
|
||||
const userToChange = this.allUserAccountList.find(user => user.username === username);
|
||||
if (userToChange) {
|
||||
userToChange.isDetailHovered = isDetailHovered;
|
||||
}
|
||||
@@ -332,9 +332,9 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
* @param {object} userDataToReplace
|
||||
*/
|
||||
updateSingleAccountPiniaState(userDataToReplace: User) {
|
||||
const userIndex = this.allUserAccoutList.findIndex(user => user.username === userDataToReplace.username);
|
||||
const userIndex = this.allUserAccountList.findIndex(user => user.username === userDataToReplace.username);
|
||||
if (userIndex !== -1) {
|
||||
this.allUserAccoutList[userIndex] = { ...this.allUserAccoutList[userIndex], ...userDataToReplace };
|
||||
this.allUserAccountList[userIndex] = { ...this.allUserAccountList[userIndex], ...userDataToReplace };
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -154,7 +154,7 @@ const infiniteStart = ref(0);
|
||||
|
||||
const shouldUpdateList = computed(() => acctMgmtStore.shouldUpdateList);
|
||||
|
||||
const allAccountResponsive = computed(() => acctMgmtStore.allUserAccoutList);
|
||||
const allAccountResponsive = computed(() => acctMgmtStore.allUserAccountList);
|
||||
const infiniteAcctData = computed(() => allAccountResponsive.value.slice(0, infiniteStart.value + ONCE_RENDER_NUM_OF_DATA));
|
||||
const loginUserData = ref(null);
|
||||
|
||||
@@ -170,9 +170,9 @@ const fetchLoginUserData = async () => {
|
||||
|
||||
const moveJustCreateUserToFirstRow = () => {
|
||||
if(infiniteAcctData.value && infiniteAcctData.value.length){
|
||||
const index = acctMgmtStore.allUserAccoutList.findIndex(user => user.username === acctMgmtStore.justCreateUsername);
|
||||
const index = acctMgmtStore.allUserAccountList.findIndex(user => user.username === acctMgmtStore.justCreateUsername);
|
||||
if (index !== -1) {
|
||||
const [justCreateUser] = acctMgmtStore.allUserAccoutList[index];
|
||||
const [justCreateUser] = acctMgmtStore.allUserAccountList[index];
|
||||
infiniteAcctData.value.unshift(justCreateUser);
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ const accountSearchResults = computed(() => {
|
||||
if(!inputQuery.value) {
|
||||
return infiniteAcctData.value;
|
||||
}
|
||||
return acctMgmtStore.allUserAccoutList.filter (user => user.username.includes(inputQuery.value));
|
||||
return acctMgmtStore.allUserAccountList.filter (user => user.username.includes(inputQuery.value));
|
||||
});
|
||||
|
||||
const onCreateNewClick = () => {
|
||||
@@ -311,7 +311,7 @@ const handleScroll = (event) => {
|
||||
};
|
||||
|
||||
const fetchMoreDataVue3 = () => {
|
||||
if(infiniteAcctData.value.length < acctMgmtStore.allUserAccoutList.length) {
|
||||
if(infiniteAcctData.value.length < acctMgmtStore.allUserAccountList.length) {
|
||||
infiniteStart.value += ONCE_RENDER_NUM_OF_DATA;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user