Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1170 Rev 1254
Línea 1... Línea 1...
1
import React from "react";
1
import React from "react";
2
import { useState, useEffect } from "react";
2
import { useState, useEffect } from "react";
3
import { Button, Modal } from "react-bootstrap";
3
import { Button, Modal } from "react-bootstrap";
4
import { useForm } from "react-hook-form";
4
import { useForm } from "react-hook-form";
5
import styled from "styled-components";
5
import styled from "styled-components";
6
import {axios} from "../../../../../utils";
6
import { axios } from "../../../../../utils";
7
import parse from "html-react-parser";
7
import parse from "html-react-parser";
8
import {CKEditor} from "ckeditor4-react";
8
import { CKEditor } from "ckeditor4-react";
9
import FormErrorFeedback from "../../../../../shared/form-error-feedback/FormErrorFeedback";
9
import FormErrorFeedback from "../../../../../shared/form-error-feedback/FormErrorFeedback";
10
import Spinner from "../../../../../shared/loading-spinner/Spinner";
10
import Spinner from "../../../../../shared/loading-spinner/Spinner";
Línea 11... Línea 11...
11
 
11
 
12
const StyledSpinnerContainer = styled.div`
12
const StyledSpinnerContainer = styled.div`
Línea 57... Línea 57...
57
  const onSubmitHandler = async (data) => {
57
  const onSubmitHandler = async (data) => {
58
    // profile/my-profiles/extended', [ 'id' => $user_profile_id_encrypted]
58
    // profile/my-profiles/extended', [ 'id' => $user_profile_id_encrypted]
59
    // https://leaderslinked.com/profile/my-profiles/extended/MzU4NDg3ODcg
59
    // https://leaderslinked.com/profile/my-profiles/extended/MzU4NDg3ODcg
60
    setLoading(true);
60
    setLoading(true);
61
    const formData = new FormData();
61
    const formData = new FormData();
62
     (data);
62
    (data);
63
    Object.entries(data).map(([key, value]) => {
63
    Object.entries(data).map(([key, value]) => {
64
      formData.append(key, value);
64
      formData.append(key, value);
65
    });
65
    });
66
    await axios
66
    await axios
67
      .post(`/my-company/${companyId}/profile/extended`, formData)
67
      .post(`/my-company/${companyId}/profile/extended`, formData)
68
      .then((response) => {
68
      .then((response) => {
69
        const resData = response.data;
69
        const resData = response.data;
70
         (resData);
70
        (resData);
71
        if (resData.success) {
71
        if (resData.success) {
72
          setSettedOverview(resData.data.description);
72
          setSettedOverview(resData.data.description);
73
          handleModalOpen();
73
          handleModalOpen();
74
        } else {
74
        } else {
75
          const resError = resData.data;
75
          const resError = resData.data;
Línea 147... Línea 147...
147
                  { name: 'styles' },
147
                  { name: 'styles' },
148
                  { name: 'colors' },
148
                  { name: 'colors' },
149
                  { name: 'tools' },
149
                  { name: 'tools' },
150
                  { name: 'others' },
150
                  { name: 'others' },
151
                ],
151
                ],
152
                // removeButtons: 'Clipboard,Paste',
152
                removeButtons: 'Anchor',
153
                removePlugins: 'elementspath'
153
                removePlugins: 'elementspath,Anchor'
154
              }}
154
              }}
155
              name="description"
155
              name="description"
156
            />
156
            />
157
            {errors.description && (
157
            {errors.description && (
158
              <FormErrorFeedback>
158
              <FormErrorFeedback>