fix: fix database init, refs NOISSUE
This commit is contained in:
@@ -27,8 +27,11 @@ def read_root():
|
||||
@app.post('/init-db')
|
||||
def initialize_database():
|
||||
"""Initialize database tables (POST endpoint for NiceGUI to call before dashboard)."""
|
||||
init_db()
|
||||
return {'message': 'Database initialized successfully'}
|
||||
try:
|
||||
init_db()
|
||||
return {'message': 'Database tables created successfully', 'status': 'success'}
|
||||
except Exception as e:
|
||||
return {'message': f'Error initializing database: {str(e)}', 'status': 'error'}
|
||||
|
||||
|
||||
frontend.init(app)
|
||||
|
||||
Reference in New Issue
Block a user