Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12990 Rev 12991
Línea 67... Línea 67...
67
	const closeSectionModal = () => {
67
	const closeSectionModal = () => {
68
		setIsShowSectionModal(false)
68
		setIsShowSectionModal(false)
69
		setSectionSelected(INITIAL_SECTION)
69
		setSectionSelected(INITIAL_SECTION)
70
	}
70
	}
Línea 71... Línea 71...
71
 
71
 
72
	const addSection = async ({ name, text }) => {
72
	const addSection = (name, text) => {
73
		const uuid = new Date().getTime()
73
		const uuid = new Date().getTime()
74
		let position = 0
-
 
75
 
-
 
76
		await content.forEach((section) => {
-
 
77
			if (position < section.position) {
74
		let position = content.length
78
				position = section.position
-
 
79
			}
75
		console.log(name)
80
			position++
-
 
Línea 81... Línea 76...
81
		})
76
		console.log(text)
82
 
77
 
83
		setContent(prev => [...prev, {
78
		setContent(prev => [...prev, {
84
			slug_section: `section${uuid}`,
79
			slug_section: `section${uuid}`,
Línea 88... Línea 83...
88
			questions: [],
83
			questions: [],
89
			status: 0
84
			status: 0
90
		}])
85
		}])
91
	}
86
	}
Línea 92... Línea 87...
92
 
87
 
93
	const editSection = ({ name, text, slug }) => {
88
	const editSection = (name, text, slug) => {
94
		setContent(prev => prev.map(contentSection => {
89
		setContent(prev => prev.map(contentSection => {
-
 
90
			if (contentSection.slug_section === slug.slug_section) {
95
			if (contentSection.slug_section === slug.slug_section) {
91
 
96
				return { ...contentSection, name: name, text: text }
92
				return { ...contentSection, name: name, text: text }
97
			}
93
			}
98
		}))
94
		}))