X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b979b48045c915f0ea95bb95d591f8ac306ddf06..1baec2d74e64375ce1b410f6a66fc8c8c9848307:/src/store/collections/collection-update-actions.ts diff --git a/src/store/collections/collection-update-actions.ts b/src/store/collections/collection-update-actions.ts index 2aa30d90..75e03d50 100644 --- a/src/store/collections/collection-update-actions.ts +++ b/src/store/collections/collection-update-actions.ts @@ -30,15 +30,6 @@ export const openCollectionUpdateDialog = (resource: ContextMenuResource) => dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME, data: {} })); }; -export const editCollection = (data: CollectionUpdateFormDialogData) => - async (dispatch: Dispatch) => { - await dispatch(updateCollection(data)); - dispatch(snackbarActions.OPEN_SNACKBAR({ - message: "Collection has been successfully updated.", - hideDuration: 2000 - })); - }; - export const updateCollection = (collection: Partial) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const uuid = collection.uuid || ''; @@ -46,13 +37,13 @@ export const updateCollection = (collection: Partial) => try { const updatedCollection = await services.collectionService.update(uuid, collection); dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: updatedCollection as CollectionResource })); - dispatch(loadDetailsPanel(updatedCollection.uuid)); - dispatch(dataExplorerActions.REQUEST_ITEMS({ id: PROJECT_PANEL_ID })); dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME })); - } catch(e) { + return updatedCollection; + } catch (e) { const error = getCommonResourceServiceError(e); if (error === CommonResourceServiceError.UNIQUE_VIOLATION) { dispatch(stopSubmit(COLLECTION_UPDATE_FORM_NAME, { name: 'Collection with the same name already exists.' })); } + return; } }; \ No newline at end of file