X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/cc493b89840b48f40c2beaf626994724331aa196..59100a72caedbc8f3c9872de1153bf3d4129122a:/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 39b97b24..34ea42f5 100644 --- a/src/store/projects/project-update-actions.ts +++ b/src/store/projects/project-update-actions.ts @@ -6,10 +6,11 @@ import { Dispatch } from "redux"; import { initialize, startSubmit, stopSubmit } from 'redux-form'; import { RootState } from "~/store/store"; import { dialogActions } from "~/store/dialog/dialog-actions"; -import { ContextMenuResource } from '~/store/context-menu/context-menu-reducer'; -import { getCommonResourceServiceError, CommonResourceServiceError } from "~/common/api/common-resource-service"; +import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service"; 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'; export interface ProjectUpdateFormDialogData { uuid: string; @@ -20,8 +21,9 @@ export interface ProjectUpdateFormDialogData { export const PROJECT_UPDATE_FORM_NAME = 'projectUpdateFormName'; export const openProjectUpdateDialog = (resource: ContextMenuResource) => - (dispatch: Dispatch) => { - dispatch(initialize(PROJECT_UPDATE_FORM_NAME, resource)); + (dispatch: Dispatch, getState: () => RootState) => { + const project = getResource(resource.uuid)(getState().resources); + dispatch(initialize(PROJECT_UPDATE_FORM_NAME, project)); dispatch(dialogActions.OPEN_DIALOG({ id: PROJECT_UPDATE_FORM_NAME, data: {} })); }; @@ -40,4 +42,4 @@ export const updateProject = (project: Partial) => } return ; } - }; \ No newline at end of file + };