Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 13004 Rev 13006
Línea 149... Línea 149...
149
			})
149
			})
150
		)
150
		)
151
	}
151
	}
Línea 152... Línea 152...
152
 
152
 
-
 
153
	const editQuestion = (question) => {
-
 
154
		setContent(current =>
-
 
155
			current.map(currentSection => {
Línea 153... Línea 156...
153
	const editQuestion = (question) => {
156
				if (currentSection.slug_section === sectionSelected.slug_section) {
154
 
157
 
155
		setContent(prev => prev.map(prevSection => {
158
					const newQuestions = currentSection.questions.map((currentQuestion) => {
-
 
159
						if (currentQuestion.slug_question === question.slug_question) {
Línea -... Línea 160...
-
 
160
							return question
-
 
161
						}
-
 
162
 
156
			if (prevSection.slug_section === question.slug_section) {
163
						return currentQuestion
157
				const questions = prevSection.questions
164
					})
-
 
165
 
-
 
166
					return { ...currentSection, questions: newQuestions }
158
 
167
				}
-
 
168
				
159
				return questions.map(prevQuestion => prevQuestion.slug_question === question.slug_question && question)
169
				return currentSection
Línea 160... Línea 170...
160
			}
170
			})
161
		}))
171
		)
162
	}
172
	}