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:
GotthardG
2025-01-30 13:39:49 +01:00
parent 44582cf38e
commit c2215860bf
20 changed files with 304 additions and 262 deletions

View File

@ -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"])