Merge branch 'master'
[arvados-workbench2.git] / src / store / collections / creator / collection-creator-reducer.ts
index 769766e192f1178886a9c746a6e459fa30ea67a5..72c999d0d198a588766e5abf9cbccaa7608446d2 100644 (file)
@@ -4,31 +4,22 @@
 
 import { collectionCreateActions, CollectionCreateAction } from './collection-creator-action';
 
-export type CollectionCreatorState = {
-    creator: CollectionCreator
-};
-
-interface CollectionCreator {
+export interface CollectionCreatorState {
     opened: boolean;
     ownerUuid: string;
 }
 
-const updateCreator = (state: CollectionCreatorState, creator?: Partial<CollectionCreator>) => ({
+const updateCreator = (state: CollectionCreatorState, creator?: Partial<CollectionCreatorState>) => ({
     ...state,
-    creator: {
-        ...state.creator,
-        ...creator
-    }
+    ...creator
 });
 
 const initialState: CollectionCreatorState = {
-    creator: {
-        opened: false,
-        ownerUuid: ""
-    }
+    opened: false,
+    ownerUuid: ''
 };
 
-export const collectionCreationReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => {
+export const collectionCreatorReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => {
     return collectionCreateActions.match(action, {
         OPEN_COLLECTION_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true }),
         CLOSE_COLLECTION_CREATOR: () => updateCreator(state, { opened: false }),