18787: Removes unnecessary action.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Mon, 30 May 2022 16:06:21 +0000 (13:06 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Mon, 30 May 2022 18:55:10 +0000 (15:55 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

src/store/collection-panel/collection-panel-action.ts
src/store/collection-panel/collection-panel-reducer.ts
src/store/collections/collection-update-actions.ts

index 55eb5949dd70d61f805a923d36f91607d1c9cb98..890a7441aa6ee14971f15517996f0b6e676a7363 100644 (file)
@@ -15,7 +15,6 @@ import { loadDetailsPanel } from 'store/details-panel/details-panel-action';
 
 export const collectionPanelActions = unionize({
     SET_COLLECTION: ofType<CollectionResource>(),
-    LOAD_COLLECTION_SUCCESS: ofType<{ item: CollectionResource }>(),
 });
 
 export type CollectionPanelAction = UnionOf<typeof collectionPanelActions>;
@@ -27,7 +26,7 @@ export const loadCollectionPanel = (uuid: string, forceReload = false) =>
             ? item
             : await services.collectionService.get(uuid);
         dispatch<any>(loadDetailsPanel(collection.uuid));
-        dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection }));
+        dispatch(collectionPanelActions.SET_COLLECTION(collection));
         dispatch(resourcesActions.SET_RESOURCES([collection]));
         return collection;
     };
index b9713f5d398011a13a82b5001e138f8fb99c65ae..6afba66c4ca8854d8bcfbdd8cb24d2900cbdd0df 100644 (file)
@@ -20,5 +20,4 @@ export const collectionPanelReducer = (state: CollectionPanelState = initialStat
              ...state,
              item,
         }),
-        LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }),
     });
index 82418d27abe75b8bbeef49b07132151ef52187bb..bf9c64492d79cef6a5f6a75708436866a9700e0b 100644 (file)
@@ -55,7 +55,7 @@ export const updateCollection = (collection: CollectionUpdateFormDialogData) =>
             properties: collection.properties }
         ).then(updatedCollection => {
             updatedCollection = {...cachedCollection, ...updatedCollection};
-            dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: updatedCollection as CollectionResource }));
+            dispatch(collectionPanelActions.SET_COLLECTION(updatedCollection));
             dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME }));
             dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_UPDATE_FORM_NAME));
             dispatch(snackbarActions.OPEN_SNACKBAR({