TSK-1189: Fix showing all available categories (#2987)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2023-04-14 20:34:03 +06:00
committed by GitHub
parent db4d240f0a
commit 4f36208880
4 changed files with 27 additions and 10 deletions
@@ -42,6 +42,7 @@
ActionContext,
focusStore,
getCategories,
getCategorySpaces,
getGroupByValues,
getPresenter,
groupBy,
@@ -167,9 +168,15 @@
const categoryFunc = viewOption as CategoryOption
if (viewOptions[viewOption.key] ?? viewOption.defaultValue) {
const categoryAction = await getResource(categoryFunc.action)
const spaces = getCategorySpaces(categories)
if (space !== undefined) {
spaces.push(space)
}
const res = await categoryAction(
_class,
space ? { space } : {},
spaces.length > 0 ? { space: { $in: Array.from(spaces.values()) } } : {},
groupByKey,
update,
queryId,