import { getNode, getNodeAncestorsIds, initTreeNode, TreeNodeStatus } from "~/models/tree";
import { Dispatch } from "redux";
import { RootState } from "~/store/store";
+import { getUserUuid } from "~/common/getuser";
import { ServiceRepository } from "~/services/services";
import { treePickerActions } from "~/store/tree-picker/tree-picker-actions";
import { FilterBuilder } from "~/services/api/filter-builder";
};
export const activateSearchBarTreeBranch = (id: string) =>
- async (dispatch: Dispatch, _: void, services: ServiceRepository) => {
- const ancestors = await services.ancestorsService.ancestors(id, services.authService.getUuid() || '');
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const userUuid = getUserUuid(getState());
+ if (!userUuid) { return; }
+ const ancestors = await services.ancestorsService.ancestors(id, userUuid);
for (const ancestor of ancestors) {
await dispatch<any>(loadSearchBarTreeProjects(ancestor.uuid));
dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id: projectUuid, pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
const params = {
filters: new FilterBuilder()
- .addEqual('ownerUuid', projectUuid)
+ .addEqual('owner_uuid', projectUuid)
.getFilters(),
order: new OrderBuilder<ProjectResource>()
.addAsc('name')
}));
dispatch(resourcesActions.SET_RESOURCES(items));
};
-