Frontend v1.3.5:
CORREGIDO: Validación de fotos obligatorias ahora usa photo_requirement === 'required' en lugar de allow_photos Las preguntas con photo_requirement configurado como 'none' o 'optional' ya NO exigirán fotos obligatorias Aplica para ambos botones: "Siguiente →" y "Finalizar Inspección" Problema corregido: Antes: La validación usaba currentQuestion.allow_photos (campo antiguo booleano) Ahora: Usa currentQuestion.photo_requirement === 'required' (nuevo sistema de 3 estados)
This commit is contained in:
@@ -5347,7 +5347,7 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl
|
||||
<button
|
||||
onClick={() => {
|
||||
// Validar que se hayan subido fotos si son obligatorias
|
||||
if (currentQuestion.allow_photos && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
if (currentQuestion.photo_requirement === 'required' && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
alert('⚠️ Debes subir al menos una fotografía para esta pregunta')
|
||||
return
|
||||
}
|
||||
@@ -5393,7 +5393,7 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl
|
||||
<button
|
||||
onClick={() => {
|
||||
// Validar que se hayan subido fotos si son obligatorias
|
||||
if (currentQuestion.allow_photos && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
if (currentQuestion.photo_requirement === 'required' && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
alert('⚠️ Debes subir al menos una fotografía para esta pregunta')
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user