Refactor Dewar service methods and improve field handling
Updated Dewar API methods to use protected endpoints for enhanced security and consistency. Added `pgroups` handling in various frontend components and modified the LogisticsView contact field for clarity. Simplified backend router imports for better readability.
This commit is contained in:
@ -7,7 +7,6 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from app import ssl_heidi
|
||||
from app.routers import (
|
||||
proposal,
|
||||
dewar,
|
||||
puck,
|
||||
spreadsheet,
|
||||
logistics,
|
||||
@ -137,8 +136,8 @@ def on_startup():
|
||||
load_slots_data(db)
|
||||
else: # dev or test environments
|
||||
print(f"{environment.capitalize()} environment: Regenerating database.")
|
||||
Base.metadata.drop_all(bind=engine)
|
||||
Base.metadata.create_all(bind=engine)
|
||||
# Base.metadata.drop_all(bind=engine)
|
||||
# Base.metadata.create_all(bind=engine)
|
||||
if environment == "dev":
|
||||
from app.database import load_sample_data
|
||||
|
||||
@ -152,10 +151,9 @@ def on_startup():
|
||||
|
||||
|
||||
# Include routers with correct configuration
|
||||
app.include_router(protected_router, prefix="/protected", tags=["protected"])
|
||||
app.include_router(protected_router, prefix="/protected")
|
||||
app.include_router(auth.router, prefix="/auth", tags=["auth"])
|
||||
app.include_router(proposal.router, prefix="/proposals", tags=["proposals"])
|
||||
app.include_router(dewar.router, prefix="/dewars", tags=["dewars"])
|
||||
app.include_router(puck.router, prefix="/pucks", tags=["pucks"])
|
||||
app.include_router(spreadsheet.router, tags=["spreadsheet"])
|
||||
app.include_router(logistics.router, prefix="/logistics", tags=["logistics"])
|
||||
|
Reference in New Issue
Block a user