Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1549 Rev 2348
Línea 1... Línea 1...
1
import React from "react";
1
import React from "react";
2
import { useEffect, useState } from "react";
2
import { useEffect, useState } from "react";
3
import { connect } from "react-redux";
3
import { connect } from "react-redux";
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 { addNotification } from "../../../redux/notification/notification.actions";
7
import { addNotification } from "../../../redux/notification/notification.actions";
8
import Spinner from "../../../shared/loading-spinner/Spinner";
8
import Spinner from "../../../shared/loading-spinner/Spinner";
9
import SavedJob from "./saved-job/SavedJob";
9
import SavedJob from "./saved-job/SavedJob";
10
import SearchList from "../../../components/SearchList";
10
import SearchList from "../../../components/SearchList";
11
import Card from "../../../components/Profile";
11
import Card from "../../../components/Profile";
Línea 47... Línea 47...
47
    setLoading(true);
47
    setLoading(true);
48
    axios
48
    axios
49
      .post(cancelLink)
49
      .post(cancelLink)
50
      .then((response) => {
50
      .then((response) => {
51
        const resData = response.data;
51
        const resData = response.data;
52
         (resData);
52
        (resData);
53
        if (resData.success) {
53
        if (resData.success) {
54
          fetchSavedJobs();
54
          fetchSavedJobs();
55
        } else {
55
        } else {
56
          const errorMsg =
56
          const errorMsg =
57
            typeof resData.data === "string"
57
            typeof resData.data === "string"
Línea 63... Línea 63...
63
          });
63
          });
64
          setLoading(false);
64
          setLoading(false);
65
        }
65
        }
66
      })
66
      })
67
      .catch((error) => {
67
      .catch((error) => {
68
         (error);
68
        (error);
69
        setLoading(false);
69
        setLoading(false);
70
      });
70
      });
71
  };
71
  };
Línea 72... Línea 72...
72
 
72
 
73
  const fetchSavedJobs = async (searchParam='') => {
73
  const fetchSavedJobs = async (searchParam = '') => {
74
    setLoading(true);
74
    setLoading(true);
75
    await axios
75
    await axios
76
      .get(
76
      .get(
77
        "/job/saved-jobs?search="+searchParam)
77
        "/job/saved-jobs?search=" + searchParam)
78
      .then((response) => {
78
      .then((response) => {
79
        const resData = response.data;
79
        const resData = response.data;
80
        if (resData.success) {
80
        if (resData.success) {
81
          setSavedJobs(resData.data);
81
          setSavedJobs(resData.data);
Línea 91... Línea 91...
91
          title="Que he guardado"
91
          title="Que he guardado"
92
          fetchCallback={fetchSavedJobs}
92
          fetchCallback={fetchSavedJobs}
93
        />
93
        />
94
        <div
94
        <div
95
          className="companies-list"
95
          className="companies-list"
-
 
96
          id="profiles-container"
96
          style={{
97
          style={{
97
            padding: "0 15px",
98
            padding: "0 15px",
98
          }}
99
          }}
99
        >
100
        >
100
          <div className="row" id="profiles-container">
-
 
101
            {savedJobs.length > 0 ? (
101
          {savedJobs.length > 0 ? (
102
              savedJobs.map(
102
            savedJobs.map(
103
                (
103
              (
104
                  {
104
                {
105
                    title,
105
                  title,
106
                    employment_type,
106
                  employment_type,
107
                    last_date_of_application,
107
                  last_date_of_application,
108
                    link_view,
108
                  link_view,
109
                    link_remove,
109
                  link_remove,
110
                  },
110
                },
111
                  index
111
                index
112
                ) => (
112
              ) => (
113
                  <Card
113
                <Card
114
                    key={index}
114
                  key={index}
115
                    // image={image}
115
                  // image={image}
116
                    name={title}
116
                  name={title}
117
                    status={employment_type}
117
                  status={employment_type}
118
                    link_view={link_view}
118
                  link_view={link_view}
119
                    link_delete={link_remove}
119
                  link_delete={link_remove}
120
                    fetchCallback={fetchSavedJobs}
120
                  fetchCallback={fetchSavedJobs}
-
 
121
                  btnAcceptTitle='Ver oferta'
-
 
122
                  btnCancelTitle='Quitar aplicación'
121
                  />
123
                />
122
                  // <SavedJob
124
                // <SavedJob
123
                  //   title={title}
125
                //   title={title}
124
                  //   employment_type={employment_type}
126
                //   employment_type={employment_type}
125
                  //   last_date_of_application={last_date_of_application}
127
                //   last_date_of_application={last_date_of_application}
126
                  //   link_view={link_view}
128
                //   link_view={link_view}
127
                  //   link_remove={link_remove}
129
                //   link_remove={link_remove}
128
                  //   onCancelApply={handleCancelApply}
130
                //   onCancelApply={handleCancelApply}
129
                  //   key={index}
131
                //   key={index}
130
                  // />
132
                // />
131
                )
-
 
132
              )
133
              )
-
 
134
            )
133
            ) : (
135
          ) : (
134
              <p>No hay resultados</p>
136
            <p>No hay resultados</p>
135
            )}
137
          )}
136
          </div>
-
 
137
          {/* <!--product-feed-tab end--> */}
138
          {/* <!--product-feed-tab end--> */}
138
        </div>
139
        </div>
139
      </div>
140
      </div>
140
      {loading && (
141
      {loading && (
141
        <StyledSpinnerContainer>
142
        <StyledSpinnerContainer>