Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 13071 Rev 13072
Línea 318... Línea 318...
318
			return deleteOption(slug)
318
			return deleteOption(slug)
319
		}
319
		}
320
	}
320
	}
Línea 321... Línea 321...
321
 
321
 
322
	const validate = () => {
322
	const validate = () => {
323
		content.map(section => {
323
		const sectionError = content.find(section => !section.questions.length)
324
			if (!section.questions.length) {
324
		if (sectionError.name) {
325
				dispatch(addNotification({
325
			dispatch(addNotification({
326
					style: 'success',
326
				style: 'danger',
327
					msg: `La sección ${section.name} no tiene preguntas`
327
				msg: `La sección ${sectionError.name} no tiene preguntas`
328
				}))
328
			}))
329
 
329
 
330
				return false
330
			return false
331
			}
331
		}
332
 
332
 
333
			section.questions.forEach(question => {
-
 
334
				if (question.type !== 'open' && question.options.length === 0) {
333
		const questionError = content.map(section =>
335
					dispatch(addNotification({
-
 
336
						style: 'success',
334
			section.questions.find(question => {
337
						msg: `La pregunta ${question.name} no tiene preguntas`
-
 
338
					}))
335
				if (!question.options.length && question.type !== 'open') {
339
					return false
336
					return question
340
				}
337
				}
Línea 341... Línea 338...
341
			})
338
			}))
-
 
339
 
342
 
340
		if (questionError.name) {
343
			return true
341
			console.log(questionError)
Línea 344... Línea 342...
344
		})
342
		}
Línea 345... Línea 343...
345
	}
343
	}