MCPcopy Create free account
hub / github.com/bhancockio/nextjs-crewai-basic-tutorial / startJob

Function startJob

nextjs_app/hooks/useCrewJob.tsx:86–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 }, [currentJobId]);
85
86 const startJob = async () => {
87 // Clear previous job data
88 setEvents([]);
89 setPositionInfoList([]);
90 setRunning(true);
91
92 try {
93 const response = await axios.post<{ job_id: string }>(
94 "http://localhost:3001/api/crew",
95 {
96 companies,
97 positions,
98 }
99 );
100
101 toast.success("Job started");
102
103 console.log("jobId", response.data.job_id);
104 setCurrentJobId(response.data.job_id);
105 } catch (error) {
106 toast.error("Failed to start job");
107 console.error(error);
108 setCurrentJobId("");
109 }
110 };
111
112 return {
113 running,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected