Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.7 kB
2
Indexable
Never
const [
    addContactsMutation
  ] = useAddContactsMutation({
    variables: importContactData
  });

  let contacts = [];

  let importContactData = {
    source: 'cloud_sponge',
    payload: JSON.stringify(contacts)
  }

  React.useEffect(() => {
    addContactsMutation();
  }, contacts);

  const userData = [
    {
      "first_name": "",
      "last_name": "",
      "phone": [],
      "email": [
          {
              "address": "selecao@htb.eng.br",
              "type": "other",
              "primary": true
          }
      ],
      "address": [],
      "groups": [],
      "companies": [],
      "photos": [],
      "locations": [],
      "_selectedMail_": "selecao@htb.eng.br",
      "_selectedPhone_": "",
      "_selectedAddress_": "",
      "_letter_": "s"
  }];



  const handleChangeValue = ({ target: { name, value } }) => {
    setTransaction((prev) => ({ ...prev, [name]: value }));

    const userData = [
      {
        "first_name": "",
        "last_name": "",
        "phone": [],
        "email": [
            {
                "address": "selecao@htb.eng.br",
                "type": "other",
                "primary": true
            }
        ],
        "address": [],
        "groups": [],
        "companies": [],
        "photos": [],
        "locations": [],
        "_selectedMail_": "selecao@htb.eng.br",
        "_selectedPhone_": "",
        "_selectedAddress_": "",
        "_letter_": "s"
    }];

    contacts = userData;

    // addContactsMutation();

    // console.log(userData);
    // useAddContactsMutation({
    //   variables: {
    //     source: 'cloud_sponge',
    //     payload: 'userData',
    //   },
    // })
  };