Spaces:
Sleeping
Sleeping
Update router get
Browse files
src/expon/presentation/interfaces/rest/controllers/presentation_controller.py
CHANGED
@@ -20,6 +20,9 @@ from src.expon.presentation.interfaces.rest.responses.presentation_response impo
|
|
20 |
PresentationSummaryResponse
|
21 |
)
|
22 |
|
|
|
|
|
|
|
23 |
router = APIRouter()
|
24 |
|
25 |
|
@@ -134,4 +137,18 @@ def delete_presentation(
|
|
134 |
storage_service.delete(presentation.filename)
|
135 |
|
136 |
# Eliminar de base de datos
|
137 |
-
repository.delete(presentation)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
PresentationSummaryResponse
|
21 |
)
|
22 |
|
23 |
+
from src.expon.feedback.infrastructure.persistence.jpa.feedback_repository import FeedbackRepository
|
24 |
+
from src.expon.feedback.interfaces.rest.feedback_response import FeedbackResponse
|
25 |
+
|
26 |
router = APIRouter()
|
27 |
|
28 |
|
|
|
137 |
storage_service.delete(presentation.filename)
|
138 |
|
139 |
# Eliminar de base de datos
|
140 |
+
repository.delete(presentation)
|
141 |
+
|
142 |
+
|
143 |
+
@router.get("/feedback/presentation/{presentation_id}", response_model=FeedbackResponse)
|
144 |
+
def get_feedback_by_presentation(
|
145 |
+
presentation_id: UUID,
|
146 |
+
db: Session = Depends(get_db)
|
147 |
+
):
|
148 |
+
repo = FeedbackRepository(db)
|
149 |
+
feedback = repo.get_by_presentation(presentation_id)
|
150 |
+
|
151 |
+
if feedback is None:
|
152 |
+
raise HTTPException(status_code=404, detail="Feedback no encontrado")
|
153 |
+
|
154 |
+
return feedback
|