From c76f803871cb38390c4248f7ac1d0e103c92188f Mon Sep 17 00:00:00 2001 From: ronalds Date: Sat, 29 Nov 2025 11:55:30 -0300 Subject: [PATCH] ACtualizacion en campos de tipo foto blouqeaba por no contestar, Actualziacion de estados del DOM de las imagenes --- frontend/src/App.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 47b55e7..4aa28a1 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -4202,7 +4202,14 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl // Validate all questions answered before completing const validateAllAnswered = () => { const visibleQuestions = getVisibleQuestions() - const unanswered = visibleQuestions.filter(q => !answers[q.id]?.value) + const unanswered = visibleQuestions.filter(q => { + // Para preguntas tipo photo_only, solo validar que tenga fotos + if (q.options?.type === 'photo_only') { + return !answers[q.id]?.photos?.length + } + // Para otros tipos, validar que tenga respuesta + return !answers[q.id]?.value + }) return unanswered } @@ -4798,10 +4805,14 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl 1} - onChange={(e) => handlePhotoChange(currentQuestion.id, e.target.files)} + onChange={(e) => { + handlePhotoChange(currentQuestion.id, e.target.files) + e.target.value = '' // Reset input después de procesar + }} className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" disabled={aiAnalyzing} required={!answers[currentQuestion.id]?.photos?.length}