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

@ -263,9 +263,9 @@ async def get_all_slots(db: Session = Depends(get_db)):
# Correct the contact_person assignment
contact_person = None
if slot.dewar and slot.dewar.contact_person:
first_name = slot.dewar.contact_person.firstname
last_name = slot.dewar.contact_person.lastname
if slot.dewar and slot.dewar.contact:
first_name = slot.dewar.contact.firstname
last_name = slot.dewar.contact.lastname
contact_person = f"{first_name} {last_name}"
# Prepare the slot data for the response
@ -287,7 +287,7 @@ async def get_all_slots(db: Session = Depends(get_db)):
if slot.dewar and slot.dewar.shipment
else None
),
contact_person=contact_person,
contact=contact_person,
local_contact="local contact placeholder",
)
# Add updated slot data to the response list