Update app.py
Browse files
app.py
CHANGED
|
@@ -569,6 +569,14 @@ def get_consultations():
|
|
| 569 |
page, per_page, search, filter_type)
|
| 570 |
return jsonify(result)
|
| 571 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 572 |
@app.route('/api/consultations/<int:consultation_id>', methods=['DELETE'])
|
| 573 |
@login_required
|
| 574 |
def delete_consultation(consultation_id):
|
|
|
|
| 569 |
page, per_page, search, filter_type)
|
| 570 |
return jsonify(result)
|
| 571 |
|
| 572 |
+
@app.route('/api/consultations/<int:consultation_id>', methods=['GET'])
|
| 573 |
+
@login_required
|
| 574 |
+
def get_consultation(consultation_id):
|
| 575 |
+
result = db.get_consultation_by_id(consultation_id, session['user_id'], session['role'])
|
| 576 |
+
if result is None:
|
| 577 |
+
return jsonify({'success': False, 'message': 'Consulta no encontrada o acceso denegado'}), 404
|
| 578 |
+
return jsonify({'success': True, 'consultation': result})
|
| 579 |
+
|
| 580 |
@app.route('/api/consultations/<int:consultation_id>', methods=['DELETE'])
|
| 581 |
@login_required
|
| 582 |
def delete_consultation(consultation_id):
|