()
| 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, |
nothing calls this directly
no outgoing calls
no test coverage detected