Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3416 Rev 3432
Línea 1... Línea 1...
1
import React, { useState } from "react";
1
import React, { useState } from "react";
2
import { Link } from "react-router-dom";
2
import { Link } from "react-router-dom";
3
import { useDispatch, useSelector } from "react-redux";
3
import { useDispatch, useSelector } from "react-redux";
4
import { Facebook, Instagram, Twitter } from "@mui/icons-material";
4
import { Facebook, Instagram, Twitter } from "@mui/icons-material";
Línea 5... Línea 5...
5
 
5
 
6
import { api } from "@api";
6
import { axios } from "../utils";
Línea 7... Línea 7...
7
import { addNotification } from "../redux/notification/notification.actions";
7
import { addNotification } from "../redux/notification/notification.actions";
8
 
8
 
Línea 29... Línea 29...
29
  const [showConfirmModal, setShowConfirmModal] = useState(false);
29
  const [showConfirmModal, setShowConfirmModal] = useState(false);
30
  const labels = useSelector(({ intl }) => intl.labels);
30
  const labels = useSelector(({ intl }) => intl.labels);
31
  const dispatch = useDispatch();
31
  const dispatch = useDispatch();
Línea 32... Línea 32...
32
 
32
 
33
  const getProfile = () => {
33
  const getProfile = () => {
34
    api.get(window.location.href).then(({ data }) => {
34
    axios.get(window.location.href).then(({ data }) => {
35
      if (data.link_request) {
35
      if (data.link_request) {
36
        return setConnectionUrl(data.link_request);
36
        return setConnectionUrl(data.link_request);
Línea 37... Línea 37...
37
      }
37
      }
38
 
38
 
39
      return setConnectionUrl(data.link_cancel);
39
      return setConnectionUrl(data.link_cancel);
Línea 40... Línea 40...
40
    });
40
    });
41
  };
41
  };
42
 
42
 
43
  const connect = () => {
43
  const connect = () => {
44
    axios.post(connectionUrl).then(({ data: response }) => {
44
    axios.post(connectionUrl).then((response) => {
45
      const { data, success } = response;
45
      const { data, success } = response.data;
46
      if (!success) {
46
      if (!success) {
47
        dispatch(addNotification({ style: "danger", msg: data }));
47
        dispatch(addNotification({ style: "danger", msg: data }));