Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 13001 Rev 13002
Línea 125... Línea 125...
125
		setIsShowQuestionModal(false)
125
		setIsShowQuestionModal(false)
126
		setQuestionSelected(INITIAL_QUESTION)
126
		setQuestionSelected(INITIAL_QUESTION)
127
	}
127
	}
Línea 128... Línea 128...
128
 
128
 
129
	const addQuestion = (question) => {
-
 
130
		console.log(question)
-
 
131
		console.log(sectionSelected)
-
 
132
		console.log(content)
129
	const addQuestion = (question) => {
Línea 133... Línea 130...
133
		const uuid = new Date().getTime()
130
		const uuid = new Date().getTime()
134
 
131
 
135
		setContent(prev => prev.map(prevSection => {
132
		setContent(prev => prev.map(prevSection => {
136
			if (prevSection.slug_section === sectionSelected.slug_section) {
133
			if (prevSection.slug_section === sectionSelected.slug_section) {
-
 
134
				return prevSection.questions.push({ ...question, slug_question: `question${uuid}` })
-
 
135
			}
137
				return prevSection.questions.push({ ...question, slug_question: `question${uuid}` })
136
 
138
			}
137
			return prevSection
Línea 139... Línea 138...
139
		}))
138
		}))
Línea 311... Línea 310...
311
																									</td>
310
																									</td>
312
																									<td className="text-capitalize">
311
																									<td className="text-capitalize">
313
																										{sectionTypeOptions[question.type]}
312
																										{sectionTypeOptions[question.type]}
314
																									</td>
313
																									</td>
315
																									<td>
314
																									<td>
316
																										<button className="btn btn-default btn-edit-question" onClick={() => showQuestionModal(question, 'edit')}>
315
																										<button className="btn btn-default btn-edit-question" onClick={() => {
-
 
316
																											showQuestionModal(question, 'edit')
-
 
317
																											setSectionSelected(section)
-
 
318
																										}}>
317
																											<i className="fa fa-edit" /> Editar Pregunta
319
																											<i className="fa fa-edit" /> Editar Pregunta
318
																										</button>
320
																										</button>
319
																										<button className="btn btn-default btn-delete-question" onClick={() => {
321
																										<button className="btn btn-default btn-delete-question" onClick={() => {
320
																											setShowDeleteModal(true)
-
 
321
																											setDeleteType('question')
-
 
322
																											setQuestionSelected(question)
322
																											setQuestionSelected(question)
323
																											setSectionSelected(section)
323
																											setDeleteType('question')
-
 
324
																											setShowDeleteModal(true)
324
																										}}>
325
																										}}>
325
																											<i className="fa fa-ban" /> Borrar Pregunta
326
																											<i className="fa fa-ban" /> Borrar Pregunta
326
																										</button>
327
																										</button>
327
																										{
328
																										{
328
																											question.type !== 'open'
329
																											question.type !== 'open'