diff --git a/backend/app/routers/puck.py b/backend/app/routers/puck.py index 24dcbc3..bbb32b6 100644 --- a/backend/app/routers/puck.py +++ b/backend/app/routers/puck.py @@ -126,4 +126,18 @@ async def get_last_tell_position(puck_id: str, db: Session = Depends(get_db)): "puck_id": puck_id, "tell_position": last_event.tell_position, "timestamp": last_event.timestamp, - } \ No newline at end of file + } + +@router.get("/pucks/slot/{slot_id}", response_model=List[PuckSchema]) +async def get_pucks_by_slot(slot_id: int, db: Session = Depends(get_db)): + """ + Retrieve all pucks for a given slot_id + """ + # Query for the pucks associated with the slot_id + pucks = db.query(PuckModel).filter(PuckModel.puck_location_in_dewar == slot_id).all() + + # If no pucks found, return an empty list + if not pucks: + return [] + + return pucks \ No newline at end of file