X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c11055f2d6ce8385088bc221eab1175e31777ec0..540750a7749cb71ea0a8fde4b7a3689eeaa1c3dd:/src/store/collections/updater/collection-updater-action.ts diff --git a/src/store/collections/updater/collection-updater-action.ts b/src/store/collections/updater/collection-updater-action.ts index 25b2f37a..1ca1a83c 100644 --- a/src/store/collections/updater/collection-updater-action.ts +++ b/src/store/collections/updater/collection-updater-action.ts @@ -2,26 +2,22 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { default as unionize, ofType, UnionOf } from "unionize"; import { Dispatch } from "redux"; - +import { unionize, ofType, UnionOf } from '~/common/unionize'; import { RootState } from "../../store"; import { ServiceRepository } from "~/services/services"; import { CollectionResource } from '~/models/collection'; import { initialize } from 'redux-form'; import { collectionPanelActions } from "../../collection-panel/collection-panel-action"; import { ContextMenuResource } from "../../context-menu/context-menu-reducer"; +import { resourcesActions } from "~/store/resources/resources-actions"; export const collectionUpdaterActions = unionize({ OPEN_COLLECTION_UPDATER: ofType<{ uuid: string }>(), CLOSE_COLLECTION_UPDATER: ofType<{}>(), UPDATE_COLLECTION_SUCCESS: ofType<{}>(), -}, { - tag: 'type', - value: 'payload' }); - export const COLLECTION_FORM_NAME = 'collectionEditDialog'; export const openUpdater = (item: ContextMenuResource) => @@ -38,10 +34,10 @@ export const updateCollection = (collection: Partial) => return services.collectionService .update(uuid, collection) .then(collection => { - dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection as CollectionResource })); - dispatch(collectionUpdaterActions.UPDATE_COLLECTION_SUCCESS()); - } - ); + dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection as CollectionResource })); + dispatch(collectionUpdaterActions.UPDATE_COLLECTION_SUCCESS()); + dispatch(resourcesActions.SET_RESOURCES([collection])); + }); }; export type CollectionUpdaterAction = UnionOf;