feat(FN-1733): add dedicated pause/resume APIs for projects
- Add pauseProject() and resumeProject() methods to ProjectEngineManager - Wire pause and resume routes to engineManager with proper error handling - Update frontend useProjectActions hook to use dedicated pause/resume APIs - Add comprehensive tests for pause/resume in ProjectEngineManager - Add route tests for project pause/resume with engineManager mocks - Fix mock stubs for getProject/updateProject/updateProjectHealth
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from "react";
|
||||
import { updateProject, unregisterProject } from "../api";
|
||||
import { pauseProject, resumeProject, unregisterProject } from "../api";
|
||||
import type { ProjectInfo } from "../api";
|
||||
import type { ViewMode } from "./useViewState";
|
||||
import type { ToastType } from "./useToast";
|
||||
@@ -81,7 +81,7 @@ export function useProjectActions(options: UseProjectActionsOptions): UseProject
|
||||
|
||||
const handlePauseProject = useCallback(async (project: ProjectInfo) => {
|
||||
try {
|
||||
await updateProject(project.id, { status: "paused" });
|
||||
await pauseProject(project.id);
|
||||
addToast(`Project ${project.name} paused`, "success");
|
||||
await refreshProjects();
|
||||
} catch {
|
||||
@@ -91,7 +91,7 @@ export function useProjectActions(options: UseProjectActionsOptions): UseProject
|
||||
|
||||
const handleResumeProject = useCallback(async (project: ProjectInfo) => {
|
||||
try {
|
||||
await updateProject(project.id, { status: "active" });
|
||||
await resumeProject(project.id);
|
||||
addToast(`Project ${project.name} resumed`, "success");
|
||||
await refreshProjects();
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user