owner-names-and-updated-navigating-on-data-explorer-name
[arvados-workbench2.git] / src / store / collection-panel / collection-panel-reducer.ts
index 44b778980bafa68eade5afb259880b5a7e7bf1e2..f09b019873e98e09b082a638a3f12a5b0eea93b2 100644 (file)
@@ -3,24 +3,19 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action";
-import { CollectionResource } from "../../models/collection";
-import { TagResource } from "../../models/tag";
+import { CollectionResource } from "~/models/collection";
 
 export interface CollectionPanelState {
     item: CollectionResource | null;
-    tags: TagResource[];
 }
 
 const initialState = {
-    item: null,
-    tags: []
+    item: null
 };
 
 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] }),
-        DELETE_COLLECTION_TAG_SUCCESS: ({ uuid }) => ({...state, tags: state.tags.filter(tag => tag.uuid !== uuid) })
+        SET_COLLECTION: (item) => ({ ...state, item }),
+        LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item })
     });