Merge branch '18787-file-browser-rerendering-fix'. Closes #18787
[arvados-workbench2.git] / src / store / collection-panel / collection-panel-reducer.ts
index 61f4127fae55b6cde9e640077f7a042fb4d5d294..6afba66c4ca8854d8bcfbdd8cb24d2900cbdd0df 100644 (file)
@@ -3,23 +3,21 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action";
-import { CollectionResource } from "../../models/collection";
-import { LinkResource } from "../../models/link";
+import { CollectionResource } from "models/collection";
 
 export interface CollectionPanelState {
     item: CollectionResource | null;
-    tags: LinkResource[];
 }
 
 const initialState = {
     item: null,
-    tags: []
 };
 
 export const collectionPanelReducer = (state: CollectionPanelState = initialState, action: CollectionPanelAction) =>
     collectionPanelActions.match(action, {
         default: () => state,
-        LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }),
-        LOAD_COLLECTION_TAGS_SUCCESS: ({ tags }) => ({...state, tags}),
-        CREATE_COLLECTION_TAG_SUCCESS: ({ tag }) => ({...state, tags: [...state.tags, tag] })
+        SET_COLLECTION: (item) => ({
+             ...state,
+             item,
+        }),
     });