Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 8479 Rev 8480
Línea 14... Línea 14...
14
    const { handleSubmit, register, setValue } = useForm()
14
    const { handleSubmit, register, setValue } = useForm()
15
    const [error, setError] = useState(null);
15
    const [error, setError] = useState(null);
16
    const [industries, setIndustries] = useState([]);
16
    const [industries, setIndustries] = useState([]);
17
    const [currentIndustry, setCurrentIndustry] = useState("");
17
    const [currentIndustry, setCurrentIndustry] = useState("");
Línea 18... Línea 18...
18
 
18
 
Línea 19... Línea -...
19
    const onSubmit = (data) => {
-
 
20
 
-
 
21
        console.log(data)
19
    const onSubmit = ({ industry }) => {
22
        console.log(editUrl)
20
 
Línea 23... Línea 21...
23
       /*  const data = new FormData()
21
        const data = new FormData()
24
        data.append("industry_id", industry)
22
        data.append("industry_id", industry)
25
 
23
 
26
        axios.post(editUrl, data)
-
 
27
            .then(({ data }) => {
-
 
28
                if (!data.success) {
-
 
29
                    return setError(data.data)
24
        axios.post(editUrl, data)
30
                }
-
 
31
                action(data.data.industry)
-
 
32
            })
-
 
33
            .then(() => {
-
 
34
                setError(null)
25
            .then(res => {
35
                closeModal()
26
                console.log(res)
Línea 36... Línea 27...
36
            })
27
            })
37
            .catch((err) => console.log(err)) */
28
            .catch((err) => console.log(err))
38
    }
29
    }
Línea 47... Línea 38...
47
                setCurrentIndustry(industry_id)
38
                setCurrentIndustry(industry_id)
48
            })
39
            })
49
    }, [isOpen]);
40
    }, [isOpen]);
Línea 50... Línea 41...
50
 
41
 
51
    useEffect(() => {
42
    useEffect(() => {
52
        setValue("industry", industries.find(el => el.value === currentIndustry))
43
        console.log(industries.find(el => el.value === currentIndustry))
Línea 53... Línea 44...
53
    }, [industries]);
44
    }, [industries]);
54
 
45
 
55
    return (
46
    return (