fix: remove duplicate route and fix journey id matching

Co-authored-by: aider (ollama/qwen2.5-coder:32b) <aider@aider.chat>
This commit is contained in:
Josh-Dev-Quest 2026-03-01 17:45:42 +01:00
parent a36ea77fb1
commit ba352d4edd
No known key found for this signature in database

View File

@ -74,7 +74,7 @@ def get_journeys():
@app.route('/api/journeys/<string:journey_id>', methods=['GET'])
def get_journey(journey_id):
"""Get a specific journey by ID."""
journey = next((j for j in journeys if j['id'] == journey_id), None)
journey = next((j for j in journeys if str(j['id']) == journey_id), None)
if journey:
return jsonify(journey)
return jsonify({'error': 'Journey not found'}), 404
@ -105,7 +105,7 @@ def create_journey():
@app.route('/api/journeys/<string:journey_id>', methods=['PUT'])
def update_journey(journey_id):
"""Update an existing journey."""
journey = next((j for j in journeys if j['id'] == journey_id), None)
journey = next((j for j in journeys if str(j['id']) == journey_id), None)
if not journey:
return jsonify({'error': 'Journey not found'}), 404
@ -126,7 +126,7 @@ def update_journey(journey_id):
def delete_journey(journey_id):
"""Delete a journey."""
global journeys
journey = next((j for j in journeys if j['id'] == journey_id), None)
journey = next((j for j in journeys if str(j['id']) == journey_id), None)
if not journey:
return jsonify({'error': 'Journey not found'}), 404