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:
parent
a36ea77fb1
commit
ba352d4edd
@ -74,7 +74,7 @@ def get_journeys():
|
|||||||
@app.route('/api/journeys/<string:journey_id>', methods=['GET'])
|
@app.route('/api/journeys/<string:journey_id>', methods=['GET'])
|
||||||
def get_journey(journey_id):
|
def get_journey(journey_id):
|
||||||
"""Get a specific journey by 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:
|
if journey:
|
||||||
return jsonify(journey)
|
return jsonify(journey)
|
||||||
return jsonify({'error': 'Journey not found'}), 404
|
return jsonify({'error': 'Journey not found'}), 404
|
||||||
@ -105,7 +105,7 @@ def create_journey():
|
|||||||
@app.route('/api/journeys/<string:journey_id>', methods=['PUT'])
|
@app.route('/api/journeys/<string:journey_id>', methods=['PUT'])
|
||||||
def update_journey(journey_id):
|
def update_journey(journey_id):
|
||||||
"""Update an existing journey."""
|
"""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:
|
if not journey:
|
||||||
return jsonify({'error': 'Journey not found'}), 404
|
return jsonify({'error': 'Journey not found'}), 404
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ def update_journey(journey_id):
|
|||||||
def delete_journey(journey_id):
|
def delete_journey(journey_id):
|
||||||
"""Delete a journey."""
|
"""Delete a journey."""
|
||||||
global journeys
|
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:
|
if not journey:
|
||||||
return jsonify({'error': 'Journey not found'}), 404
|
return jsonify({'error': 'Journey not found'}), 404
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user