Web: People: fixed group list query
This commit is contained in:
parent
bf6cb4b134
commit
e304af064b
@ -44,9 +44,9 @@ export function deleteGroup(id) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getGroupListFull() {
|
||||
/*export function getGroupListFull() {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/group/full",
|
||||
});
|
||||
}
|
||||
}*/ //TODO: use after fixing problems on the server
|
||||
|
@ -16,7 +16,7 @@ class GroupsStore {
|
||||
}
|
||||
|
||||
getGroupList = async () => {
|
||||
const res = await api.groups.getGroupListFull();
|
||||
const res = await api.groups.getGroupList(); //TODO: replace with getGroupListFull() after fixing problems on the server
|
||||
this.groups = res;
|
||||
};
|
||||
|
||||
|
@ -59,8 +59,15 @@ class SelectedGroupStore {
|
||||
const { group, search, role, activationStatus, employeeStatus } = filter;
|
||||
|
||||
let countMembers;
|
||||
groups.filter((el) => {
|
||||
if (el.id === group) countMembers = el.members.length;
|
||||
groups.filter(async (el) => {
|
||||
if (el.id === group) {
|
||||
if (!el.members) {
|
||||
const currGroup = await getGroup(el.id);
|
||||
countMembers = currGroup.members.length; // TODO: simplify after fixing server issues with getGroupListFull
|
||||
} else {
|
||||
countMembers = el.members.length;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const filterIsClear =
|
||||
|
Loading…
Reference in New Issue
Block a user