Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5416 Rev 5417
Línea 14... Línea 14...
14
  twitter,
14
  twitter,
15
  instagram,
15
  instagram,
16
  totalFollowers,
16
  totalFollowers,
17
  markFollower
17
  markFollower
18
}) => {
18
}) => {
19
  const [authLinks, setAuthLinks] = useState(null)
19
  const [authLinks, setAuthLinks] = useState({})
20
  const [followers, setFollowers] = useState(totalFollowers)
20
  const [followers, setFollowers] = useState(totalFollowers)
Línea 21... Línea 21...
21
 
21
 
22
  const authClasses = {
22
  const authClasses = {
23
    link_unfollow: 'secondary',
23
    link_unfollow: 'secondary',
Línea 41... Línea 41...
41
  }
41
  }
Línea 42... Línea 42...
42
 
42
 
43
  const fetchAuthLinks = async () => {
43
  const fetchAuthLinks = async () => {
44
    const response = await axios.get(`/company/view/${companyId}`)
44
    const response = await axios.get(`/company/view/${companyId}`)
-
 
45
    const { success, data } = response.data
45
    const { success, data } = response.data
46
 
46
    if (success) {
47
    if (success) {
47
      setAuthLinks(data)
48
      setAuthLinks(data)
-
 
49
      setFollowers(data.total_followers)
48
      setFollowers(data.total_followers)
50
 
49
      if (data.link_unfollow) {
51
      if (data.link_unfollow) {
50
        markFollower(true)
52
        markFollower(true)
51
      } else {
53
      } else {
52
        markFollower(false)
54
        markFollower(false)
Línea 55... Línea 57...
55
  }
57
  }
Línea 56... Línea 58...
56
 
58
 
57
  const handleButtonAction = async (link) => {
59
  const handleButtonAction = async (link) => {
58
    const response = await axios.post(link)
60
    const response = await axios.post(link)
-
 
61
    const { success, data } = response.data
59
    const { success, data } = response.data
62
 
60
    if (success) {
63
    if (success) {
61
      addNotification({ style: 'success', msg: data })
64
      addNotification({ style: 'success', msg: data })
62
      fetchAuthLinks()
65
      fetchAuthLinks()
63
    } else {
66
    } else {