diff --git a/backend/app/routers/sample.py b/backend/app/routers/sample.py index 13ecc6f..bb4b695 100644 --- a/backend/app/routers/sample.py +++ b/backend/app/routers/sample.py @@ -99,7 +99,12 @@ async def get_last_sample_event(sample_id: int, db: Session = Depends(get_db)): if not last_event: raise HTTPException(status_code=404, detail="No events found for the sample") - return last_event # Response will automatically use the SampleEventResponse schema + return SampleEventResponse( + id=last_event.id, + sample_id=last_event.sample_id, + event_type=last_event.event_type, + timestamp=last_event.timestamp, + ) # Response will automatically use the SampleEventResponse schema @router.post("/samples/{sample_id}/upload-images")