.
This commit is contained in:
@@ -111,7 +111,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
<td className="py-9">
|
<td className="py-9">
|
||||||
<div className="sm:flex sm:space-x-2 sm:justify-between sm:items-center job-items">
|
<div className="sm:flex sm:space-x-2 sm:justify-between sm:items-center job-items">
|
||||||
<div className="flex space-x-2 items-center job-items w-full">
|
<div className="flex space-x-2 items-center job-items w-full">
|
||||||
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px]">
|
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] min-w-[60px] max-w-[60px]">
|
||||||
<img
|
<img
|
||||||
src={dataImage2}
|
src={dataImage2}
|
||||||
alt="data"
|
alt="data"
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
// Getting market data
|
// Getting market data
|
||||||
const getMarketActiveJobList = async () => {
|
const getMarketActiveJobList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await apiCall.getMyJobList();
|
const res = await apiCall.getActiveJobList();
|
||||||
|
console.log('Checking job data from auth', res)
|
||||||
dispatch(updateJobs(res.data));
|
dispatch(updateJobs(res.data));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error getting mode");
|
console.log("Error getting mode");
|
||||||
|
|||||||
+31
-34
@@ -1,5 +1,5 @@
|
|||||||
//import React from "react";
|
//import React from "react";
|
||||||
import React, { useContext,useState, useEffect } from "react";
|
import React, { useContext, useState, useEffect } from "react";
|
||||||
// import MyTasks from "../components/MyTasks";
|
// import MyTasks from "../components/MyTasks";
|
||||||
// import UsersService from "../services/UsersService";
|
// import UsersService from "../services/UsersService";
|
||||||
import usersService from "../services/UsersService";
|
import usersService from "../services/UsersService";
|
||||||
@@ -7,40 +7,37 @@ import MyJobs from "../components/MyJobs";
|
|||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function MyJobsPage() {
|
export default function MyJobsPage() {
|
||||||
|
const commonHeadData = () => {
|
||||||
|
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
const commonHeadData =()=>{
|
const { jobListTable } = useSelector((state) => state.tableReload);
|
||||||
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
|
||||||
return 0;
|
// const userApi = new usersService();
|
||||||
|
// const activeJobList = userApi.getMyJobList();
|
||||||
|
const [MyJobList, setMyJobList] = useState({ loading: true, data: [] });
|
||||||
|
const api = new usersService();
|
||||||
|
|
||||||
|
const getMyJobList = async () => {
|
||||||
|
setMyJobList({ loading: true, data: [] });
|
||||||
|
try {
|
||||||
|
const res = await api.getMyJobList();
|
||||||
|
setMyJobList({ loading: false, data: res.data });
|
||||||
|
// setMyJobList(res.data);
|
||||||
|
} catch (error) {
|
||||||
|
setMyJobList({ loading: false, data: [] });
|
||||||
|
console.log("Error getting mode");
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
getMyJobList();
|
||||||
|
}, [jobListTable]);
|
||||||
|
|
||||||
const {jobListTable} = useSelector((state) => state.tableReload)
|
// debugger;
|
||||||
|
return (
|
||||||
// const userApi = new usersService();
|
<>
|
||||||
// const activeJobList = userApi.getMyJobList();
|
<MyJobs MyJobList={MyJobList} commonHeadData={commonHeadData} />
|
||||||
const [MyJobList, setMyJobList] = useState({loading: true, data:[]});
|
</>
|
||||||
const api = new usersService();
|
);
|
||||||
|
|
||||||
const getMyJobList = async () => {
|
|
||||||
setMyJobList({loading: true, data:[]})
|
|
||||||
try {
|
|
||||||
const res = await api.getMyJobList();
|
|
||||||
setMyJobList({loading: false, data:res.data})
|
|
||||||
// setMyJobList(res.data);
|
|
||||||
} catch (error) {
|
|
||||||
setMyJobList({loading: false, data:[]})
|
|
||||||
console.log("Error getting mode");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
useEffect(() => {
|
|
||||||
getMyJobList();
|
|
||||||
}, [jobListTable]);
|
|
||||||
|
|
||||||
// debugger;
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<MyJobs
|
|
||||||
MyJobList={MyJobList}
|
|
||||||
commonHeadData={commonHeadData} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user