1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from "redux";
6 import { ServiceRepository } from "services/services";
7 import { projectPanelActions } from "store/project-panel/project-panel-action";
8 import { loadResource } from "store/resources/resources-actions";
9 import { RootState } from "store/store";
11 export const freezeProject = (uuid: string) =>
12 async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
13 const userUUID = getState().auth.user!.uuid;
15 const updatedProject = await services.projectService.update(uuid, {
16 frozenByUuid: userUUID
19 dispatch(projectPanelActions.REQUEST_ITEMS());
20 dispatch<any>(loadResource(uuid, false));
21 return updatedProject;
24 export const unfreezeProject = (uuid: string) =>
25 async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
27 const updatedProject = await services.projectService.update(uuid, {
31 dispatch(projectPanelActions.REQUEST_ITEMS());
32 dispatch<any>(loadResource(uuid, false));
33 return updatedProject;