X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3367b1ff2a1d1050bb435f7bc8230c03435b2529..e69ce2f8f14e4272acf5efa4c8a252bc101227ca:/src/store/projects/project-update-actions.ts diff --git a/src/store/projects/project-update-actions.ts b/src/store/projects/project-update-actions.ts index 34ea42f5..b9206976 100644 --- a/src/store/projects/project-update-actions.ts +++ b/src/store/projects/project-update-actions.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import { Dispatch } from "redux"; -import { initialize, startSubmit, stopSubmit } from 'redux-form'; +import { FormErrors, initialize, startSubmit, stopSubmit } from 'redux-form'; import { RootState } from "~/store/store"; import { dialogActions } from "~/store/dialog/dialog-actions"; import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service"; @@ -11,6 +11,7 @@ import { ServiceRepository } from "~/services/services"; import { ProjectResource } from '~/models/project'; import { ContextMenuResource } from "~/store/context-menu/context-menu-actions"; import { getResource } from '~/store/resources/resources'; +import { projectPanelActions } from '~/store/project-panel/project-panel-action'; export interface ProjectUpdateFormDialogData { uuid: string; @@ -33,12 +34,13 @@ export const updateProject = (project: Partial) => dispatch(startSubmit(PROJECT_UPDATE_FORM_NAME)); try { const updatedProject = await services.projectService.update(uuid, project); + dispatch(projectPanelActions.REQUEST_ITEMS()); dispatch(dialogActions.CLOSE_DIALOG({ id: PROJECT_UPDATE_FORM_NAME })); return updatedProject; } catch (e) { const error = getCommonResourceServiceError(e); if (error === CommonResourceServiceError.UNIQUE_VIOLATION) { - dispatch(stopSubmit(PROJECT_UPDATE_FORM_NAME, { name: 'Project with the same name already exists.' })); + dispatch(stopSubmit(PROJECT_UPDATE_FORM_NAME, { name: 'Project with the same name already exists.' } as FormErrors)); } return ; }