Web: People: fixed group list query

This commit is contained in:
Artem Tarasov 2021-04-05 16:18:41 +03:00
parent bf6cb4b134
commit e304af064b
3 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

@ -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 =