Spaces:
Sleeping
Sleeping
feat: update router get
Browse files
src/expon/feedback/interfaces/rest/feedback_controller.py
CHANGED
@@ -28,8 +28,14 @@ def get_feedback_by_user(user_id: UUID, db: Session = Depends(get_db)):
|
|
28 |
return results
|
29 |
|
30 |
|
31 |
-
@router.get("/presentation/{presentation_id}", response_model=
|
32 |
def get_feedback_by_presentation(presentation_id: UUID, db: Session = Depends(get_db)):
|
33 |
repo = FeedbackRepository(db)
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
return results
|
29 |
|
30 |
|
31 |
+
@router.get("/presentation/{presentation_id}", response_model=FeedbackResponse)
|
32 |
def get_feedback_by_presentation(presentation_id: UUID, db: Session = Depends(get_db)):
|
33 |
repo = FeedbackRepository(db)
|
34 |
+
result = repo.get_by_presentation(presentation_id)
|
35 |
+
|
36 |
+
if result is None:
|
37 |
+
from fastapi import HTTPException
|
38 |
+
raise HTTPException(status_code=404, detail="Feedback no encontrado")
|
39 |
+
|
40 |
+
return result
|
41 |
+
|