Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7202 Rev 7204
Línea 103... Línea 103...
103
    register('description', { required: true })
103
    register('description', { required: true })
104
    register('category_id', { required: true })
104
    register('category_id', { required: true })
105
  }, [])
105
  }, [])
Línea 106... Línea 106...
106
 
106
 
107
  useEffect(() => {
107
  useEffect(() => {
Línea 108... Línea 108...
108
    if (!url || !show || !isEdit) return
108
    if (!url || !show || !isEdit || !questionsCategories.length) return
109
 
109
 
Línea 110... Línea 110...
110
    axios.get(url).then((response) => {
110
    axios.get(url).then((response) => {
Línea 127... Línea 127...
127
 
127
 
Línea 128... Línea 128...
128
      const categories = []
128
      const categories = []
129
 
129
 
-
 
130
      for (const id in data.category_id) {
130
      for (const id in data.category_id) {
131
        const category = questionsCategories.find((c) => c.value === id)
131
        const category = questionsCategories.find((c) => c.value === id)
132
        console.log(id)
Línea -... Línea 133...
-
 
133
        categories.concat(category)
132
        categories.concat(category)
134
      }
Línea 133... Línea 135...
133
      }
135
 
134
 
136
      console.log(categories)
135
      setCurrentCategories(categories)
137
      setCurrentCategories(categories)
136
 
138
 
Línea 137... Línea 139...
137
      setValue('title', data.title)
139
      setValue('title', data.title)
138
      setValue('description', data.description)
140
      setValue('description', data.description)
139
    })
141
    })
140
  }, [url, show, isEdit])
142
  }, [url, show, isEdit, questionsCategories])