Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1099,6 +1099,26 @@ def cloud_sync():
|
|
| 1099 |
return jsonify({'error': str(e)})
|
| 1100 |
|
| 1101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1102 |
@app.route('/delete_report/<int:report_id>', methods=['POST'])
|
| 1103 |
@login_required
|
| 1104 |
def delete_report_route(report_id):
|
|
|
|
| 1099 |
return jsonify({'error': str(e)})
|
| 1100 |
|
| 1101 |
|
| 1102 |
+
@app.route('/update_report', methods=['POST'])
|
| 1103 |
+
@login_required
|
| 1104 |
+
def update_report():
|
| 1105 |
+
import db
|
| 1106 |
+
data = request.json
|
| 1107 |
+
report_id = data.get('report_id')
|
| 1108 |
+
specificity = data.get('specificity', '')
|
| 1109 |
+
comment = data.get('comment', '')
|
| 1110 |
+
if not report_id:
|
| 1111 |
+
return jsonify({'error': 'missing report_id'}), 400
|
| 1112 |
+
conn = db.get_conn()
|
| 1113 |
+
db.backup_db()
|
| 1114 |
+
conn.execute("""UPDATE reports SET specificity=?, comment=?,
|
| 1115 |
+
updated_at=datetime('now','localtime') WHERE id=?""",
|
| 1116 |
+
(specificity, comment, report_id))
|
| 1117 |
+
conn.commit()
|
| 1118 |
+
conn.close()
|
| 1119 |
+
return jsonify({'ok': True})
|
| 1120 |
+
|
| 1121 |
+
|
| 1122 |
@app.route('/delete_report/<int:report_id>', methods=['POST'])
|
| 1123 |
@login_required
|
| 1124 |
def delete_report_route(report_id):
|