()
| 48 | |
| 49 | @app.route('/api/crew', methods=['POST']) |
| 50 | def run_crew(): |
| 51 | logger.info("Received request to run crew") |
| 52 | # Validation |
| 53 | data = request.json |
| 54 | if not data or 'companies' not in data or 'positions' not in data: |
| 55 | abort(400, description="Invalid input data provided.") |
| 56 | |
| 57 | job_id = str(uuid4()) |
| 58 | companies = data['companies'] |
| 59 | positions = data['positions'] |
| 60 | |
| 61 | thread = Thread(target=kickoff_crew, args=( |
| 62 | job_id, companies, positions)) |
| 63 | thread.start() |
| 64 | |
| 65 | return jsonify({"job_id": job_id}), 202 |
| 66 | |
| 67 | |
| 68 | @app.route('/api/crew/<job_id>', methods=['GET']) |
nothing calls this directly
no outgoing calls
no test coverage detected