alexander1010 commited on
Commit
fe951fb
·
verified ·
1 Parent(s): d08efd1

feat: update router delete

Browse files
src/expon/presentation/interfaces/rest/controllers/presentation_controller.py CHANGED
@@ -127,6 +127,8 @@ def delete_presentation(
127
  current_user=Depends(get_current_user)
128
  ):
129
  repository = PresentationRepository(db)
 
 
130
  presentation = repository.get_by_id_and_user(presentation_id, current_user.id)
131
 
132
  if presentation is None:
@@ -136,10 +138,14 @@ def delete_presentation(
136
  storage_service = LocalStorageService()
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,
 
127
  current_user=Depends(get_current_user)
128
  ):
129
  repository = PresentationRepository(db)
130
+ feedback_repo = FeedbackRepository(db)
131
+
132
  presentation = repository.get_by_id_and_user(presentation_id, current_user.id)
133
 
134
  if presentation is None:
 
138
  storage_service = LocalStorageService()
139
  storage_service.delete(presentation.filename)
140
 
141
+ # Eliminar feedbacks asociados
142
+ feedback_repo.delete_by_presentation(presentation_id)
143
+
144
  # Eliminar de base de datos
145
  repository.delete(presentation)
146
 
147
 
148
+
149
  @router.get("/feedback/presentation/{presentation_id}", response_model=FeedbackResponse)
150
  def get_feedback_by_presentation(
151
  presentation_id: UUID,