Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 13074 | Rev 13076 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 13074 Rev 13075
Línea 320... Línea 320...
320
		}
320
		}
321
	}
321
	}
Línea 322... Línea 322...
322
 
322
 
323
	const validate = () => {
323
	const validate = () => {
324
		const sectionError = content.find(section => !section.questions.length)
324
		const sectionError = content.find(section => !section.questions.length)
Línea 325... Línea -...
325
		const questionsToOptions = content.map(section => section.questions.map(question => question.type !== 'open'))
-
 
326
 
-
 
327
		const questionError = questionsToOptions.find(question => !question.options.length)
325
		let questionsToOptions = []
328
		
326
 
329
		if (sectionError.name) {
327
		if (sectionError.name) {
330
			dispatch(addNotification({
328
			dispatch(addNotification({
331
				style: 'danger',
329
				style: 'danger',
Línea 332... Línea 330...
332
				msg: `La sección ${sectionError.name} no tiene preguntas`
330
				msg: `La sección ${sectionError.name} no tiene preguntas`
333
			}))
331
			}))
Línea -... Línea 332...
-
 
332
 
-
 
333
			return false
-
 
334
		}
-
 
335
 
-
 
336
		content.forEach(section => section.questions.map(question => {
Línea 334... Línea 337...
334
 
337
			if (question.type !== 'open') {
Línea 335... Línea 338...
335
			return false
338
				questionsToOptions = [...questionsToOptions, question]