Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 320 Rev 340
Línea 13... Línea 13...
13
 
13
 
14
    /**
14
    /**
15
     * Init States
15
     * Init States
16
     */
16
     */
-
 
17
    const [data, setData] = useState([]);
17
    const [data, setData] = useState([]);
18
    const [action, setAction] = useState();
18
    const [test, setTest] = useState();
19
    const [test, setTest] = useState();
Línea 19... Línea 20...
19
    const [loading, setLoading] = useState(true);
20
    const [loading, setLoading] = useState(true);
20
 
21
 
21
    /**
22
    /**
22
     * Get All self evaluation tests
23
     * Get All self evaluation tests
23
     */
-
 
24
    const fetchData = async (searchParam = '') => {
24
     */
25
 
-
 
26
        setLoading(true);
25
    const fetchData = async (searchParam = '') => {
27
        await axios
26
        setLoading(true);
28
            .get(
27
        axios.get(
29
                "/profile/self-evaluation?search=" + searchParam)
28
            "/profile/self-evaluation?search=" + searchParam)
30
            .then((response) => {
29
            .then((response) => {
31
                if (response.data.success) {
30
                if (response.data.success) {
32
                    setData(response.data.data);
31
                    setData(response.data.data);
Línea 38... Línea 37...
38
    /**
37
    /**
39
     * get info test
38
     * get info test
40
     * @param {*} url 
39
     * @param {*} url 
41
     */
40
     */
42
    const getTestByUrl = async (url) => {
41
    const getTestByUrl = async (url) => {
43
        await axios
-
 
44
            .get(url)
42
        axios.get(url)
45
            .then((response) => {
43
            .then((response) => {
46
                if (response.data.data) {
44
                if (response.data.data) {
-
 
45
                    setAction(url);
47
                    setTest(response.data.data);
46
                    setTest(response.data.data);
48
                }
47
                }
49
            });
48
            });
50
    };
49
    };
Línea 58... Línea 57...
58
    /**
57
    /**
59
     * componentDidMount
58
     * componentDidMount
60
     */
59
     */
61
    useEffect(() => {
60
    useEffect(() => {
62
        fetchData();
61
        fetchData();
63
    }, []);
62
    }, [test]);
Línea 64... Línea 63...
64
 
63
 
65
    return (
64
    return (
66
        <section className="companies-info">
65
        <section className="companies-info">
67
            {!test ? (
66
            {!test ? (
Línea 85... Línea 84...
85
                <div className="container">
84
                <div className="container">
86
                    <Test
85
                    <Test
87
                        backendVars={backendVars}
86
                        backendVars={backendVars}
88
                        loading={loading}
87
                        loading={loading}
89
                        setTest={setTest}
88
                        setTest={setTest}
90
                        test={test} />
89
                        test={test}
-
 
90
                        action ={ action}
-
 
91
                        />
91
                </div>
92
                </div>
92
            )}
93
            )}
93
        </section>
94
        </section>
Línea 94... Línea 95...
94
 
95