Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 13003 Rev 13004
Línea 127... Línea 127...
127
	}
127
	}
Línea 128... Línea 128...
128
 
128
 
129
	const addQuestion = (question) => {
129
	const addQuestion = (question) => {
Línea -... Línea 130...
-
 
130
		const uuid = new Date().getTime()
130
		const uuid = new Date().getTime()
131
 
131
 
132
		setContent(current =>
-
 
133
			current.map(currentSection => {
-
 
134
				if (currentSection.slug_section === sectionSelected.slug_section) {
-
 
135
					return {
-
 
136
						...currentSection,
-
 
137
						questions: [
-
 
138
							...currentSection.questions,
132
		setContent(prev => prev.map(prevSection => {
139
							{
-
 
140
								...question,
-
 
141
								slug_question: `question${uuid}`,
-
 
142
								slug_section: sectionSelected.slug_section,
-
 
143
							}
133
			if (prevSection.slug_section === sectionSelected.slug_section) {
144
						]
Línea 134... Línea 145...
134
				return prevSection.questions.push({ ...question, slug_question: `question${uuid}` })
145
					}
135
			}
146
				}
-
 
147
 
136
 
148
				return currentSection
Línea 137... Línea 149...
137
			return prevSection
149
			})
Línea 138... Línea 150...
138
		}))
150
		)