Fix route registration by moving main block to end of file

Co-authored-by: aiulian25 <17886483+aiulian25@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-12 21:42:33 +00:00
parent 8a5b916a39
commit 0eb54dfd30
2 changed files with 9 additions and 5 deletions

View file

@ -796,11 +796,6 @@ def export_data(data_type):
df.to_csv(output_file, index=False)
return send_from_directory('/tmp', f'{data_type}_{vehicle_id}.csv', as_attachment=True)
if __name__ == '__main__':
with app.app_context():
db.create_all()
app.run(host='0.0.0.0', port=5000, debug=False)
# Edit/Delete operations for Service Records
@app.route('/api/vehicles/<int:vehicle_id>/service-records/<int:record_id>', methods=['GET', 'PUT', 'DELETE'])
@login_required
@ -902,3 +897,8 @@ def reminder_operations(vehicle_id, reminder_id):
db.session.delete(reminder)
db.session.commit()
return jsonify({'message': 'Reminder deleted successfully'})
if __name__ == '__main__':
with app.app_context():
db.create_all()
app.run(host='0.0.0.0', port=5000, debug=False)