Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2434 Rev 2924
Línea 8... Línea 8...
8
 
8
 
9
  // states
9
  // states
10
  const [suggestedGroups, setSuggestedGroups] = useState([]);
10
  const [suggestedGroups, setSuggestedGroups] = useState([]);
11
  const [lookMore, setLookMore] = useState(false);
11
  const [lookMore, setLookMore] = useState(false);
12
  useEffect(() => {
12
  useEffect(() => {
-
 
13
    const url = groupId ? `/helpers/groups-suggestion/${groupId}` : '/helpers/groups-suggestion'
-
 
14
    
13
    axios.get(`/helpers/groups-suggestion/${groupId}`).then((response) => {
15
    axios.get(url)
14
      const resData = response.data;
16
      .then(({ data }) => {
15
      if (resData.success) {
17
        if (data.success) {
16
        setSuggestedGroups(resData.data);
-
 
17
      } else {
-
 
18
        // alert error
18
          setSuggestedGroups(data.data);
19
      }
19
        }
20
    });
20
      });
Línea 21... Línea 21...
21
  }, []);
21
  }, []);
22
 
22
 
23
  const getData = () => {
23
  const getData = () => {