20000: Add run button to resume cancelled processes (priority 0)
[arvados-workbench2.git] / src / store / processes / processes-actions.ts
index 815d6aec5e37eb443f3f636a58c63d990481684d..cfda51ddc9fde7524d3e34b700f66d7f76a0b382 100644 (file)
@@ -114,12 +114,24 @@ export const cancelRunningWorkflow = (uuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         try {
             const process = await services.containerRequestService.update(uuid, { priority: 0 });
+            dispatch<any>(updateResources([process]));
             return process;
         } catch (e) {
             throw new Error('Could not cancel the process.');
         }
     };
 
+export const resumeOnHoldWorkflow = (uuid: string) =>
+    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+        try {
+            const process = await services.containerRequestService.update(uuid, { priority: 500 });
+            dispatch<any>(updateResources([process]));
+            return process;
+        } catch (e) {
+            throw new Error('Could not resume the process.');
+        }
+    };
+
 export const startWorkflow = (uuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         try {