// SPDX-License-Identifier: AGPL-3.0
import { Dispatch } from "redux";
-import { loadCollectionFiles, COLLECTION_PANEL_LOAD_FILES_THRESHOLD } from "./collection-panel-files/collection-panel-files-actions";
+import {
+ loadCollectionFiles,
+ COLLECTION_PANEL_LOAD_FILES_THRESHOLD
+} from "./collection-panel-files/collection-panel-files-actions";
import { CollectionResource } from '~/models/collection';
import { RootState } from "~/store/store";
import { ServiceRepository } from "~/services/services";
export const collectionPanelActions = unionize({
SET_COLLECTION: ofType<CollectionResource>(),
- LOAD_COLLECTION: ofType<{ uuid: string }>(),
LOAD_COLLECTION_SUCCESS: ofType<{ item: CollectionResource }>(),
LOAD_BIG_COLLECTIONS: ofType<boolean>(),
});
export const loadCollectionPanel = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const { collectionPanel: { item } } = getState();
- dispatch(collectionPanelActions.LOAD_COLLECTION({ uuid }));
const collection = item ? item : await services.collectionService.get(uuid);
- dispatch(loadDetailsPanel(collection.uuid));
+ dispatch<any>(loadDetailsPanel(collection.uuid));
dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection }));
dispatch(resourcesActions.SET_RESOURCES([collection]));
if (collection.fileCount <= COLLECTION_PANEL_LOAD_FILES_THRESHOLD &&