diff --git a/src/Routers.jsx b/src/Routers.jsx
index af3f32f..7240e91 100644
--- a/src/Routers.jsx
+++ b/src/Routers.jsx
@@ -89,7 +89,7 @@ export default function Routers() {
} />
} />
} />
- {/* } /> */}
+ } />
} />
} />
} />
diff --git a/src/components/AddJob/AddJob.jsx b/src/components/AddJob/AddJob.jsx
index b6dc1d6..14d82eb 100644
--- a/src/components/AddJob/AddJob.jsx
+++ b/src/components/AddJob/AddJob.jsx
@@ -3,11 +3,8 @@ import { Link } from "react-router-dom";
import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import usersService from "../../services/UsersService";
-
import { useSelector, useDispatch } from "react-redux";
-
import { tableReload } from "../../store/TableReloads";
-
import { Field, Form, Formik } from "formik";
import * as Yup from "yup";
@@ -36,9 +33,10 @@ const validationSchema = Yup.object().shape({
.typeError("you must specify a number")
.min(1, "Price must be greater than 0")
.required("Timeline is required"),
+ category: Yup.array().min(1, "Select at least one checkbox"),
});
-function AddJob({ popUpHandler }) {
+function AddJob({ popUpHandler, categories }) {
const ApiCall = new usersService();
let dispatch = useDispatch();
@@ -58,6 +56,7 @@ function AddJob({ popUpHandler }) {
description: "",
job_detail: "",
timeline_days: "",
+ category: [],
};
let [requestStatus, setRequestStatus] = useState({
@@ -88,6 +87,7 @@ function AddJob({ popUpHandler }) {
// FUNCTION TO HANDLE ADD JOB FORM
const handleAddJob = (values, helpers) => {
+ values.category = values.category?.join("@");
setRequestStatus({ loading: true, status: false, message: "" });
ApiCall.jobManagerCreateJob(values)
.then((res) => {
@@ -127,6 +127,8 @@ function AddJob({ popUpHandler }) {
getUserCountry();
}, []);
+ console.log("This is for AddJob >>", categories);
+
return (
+
-
+
{" "}
Cancel
diff --git a/src/components/Helpers/Inputs/InputCom/index.jsx b/src/components/Helpers/Inputs/InputCom/index.jsx
index f05dd0d..43dc849 100644
--- a/src/components/Helpers/Inputs/InputCom/index.jsx
+++ b/src/components/Helpers/Inputs/InputCom/index.jsx
@@ -21,7 +21,8 @@ export default function InputCom({
blurHandler,
spanTag,
inputBg,
- direction
+ direction,
+ errorBorder
}) {
const inputRef = useRef(null);
// Entry Validation
@@ -73,7 +74,7 @@ export default function InputCom({
)}
({ All: "All Categories", ...categories }),
[categories]
);
- const [tab, setTab] = useState(marketCategories.All);
+ const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
// Convert to array in order to map
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
@@ -24,7 +24,7 @@ export default function MainSection({
setTab(value);
};
useEffect(() => {
- if (tab === marketCategories.All) {
+ if (tab === "All") {
setProducts(marketPlaceProduct);
} else {
const filteredProducts = marketPlaceProduct.filter((product) =>
diff --git a/src/components/MyJobs/MyJobTable.jsx b/src/components/MyJobs/MyJobTable.jsx
index e9b7487..f0e5bfa 100644
--- a/src/components/MyJobs/MyJobTable.jsx
+++ b/src/components/MyJobs/MyJobTable.jsx
@@ -280,6 +280,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
}}
situation={editJob.show}
country={myCountry}
+ categories={currentJobCart}
/>
)}
diff --git a/src/components/MyJobs/index.jsx b/src/components/MyJobs/index.jsx
index 2f96bf8..e3d9458 100644
--- a/src/components/MyJobs/index.jsx
+++ b/src/components/MyJobs/index.jsx
@@ -10,6 +10,8 @@ export default function MyJobs(props) {
setPopUp((prev) => !prev);
};
+ const categoryOptions = props.MyJobList?.data?.categories;
+
return (
@@ -35,7 +37,13 @@ export default function MyJobs(props) {
{/* Add Job List Popout */}
- {popUp &&
}
+ {popUp && (
+
+ )}
{/* End of Add Job List Popout */}
);
diff --git a/src/components/jobPopout/EditJobPopout.jsx b/src/components/jobPopout/EditJobPopout.jsx
index d7e143c..4213249 100644
--- a/src/components/jobPopout/EditJobPopout.jsx
+++ b/src/components/jobPopout/EditJobPopout.jsx
@@ -9,9 +9,14 @@ import { useNavigate } from "react-router-dom";
import { tableReload } from "../../store/TableReloads";
import { useDispatch } from "react-redux";
-const EditJobPopOut = ({ details, onClose, situation, country }) => {
-
- const dispatch = useDispatch()
+const EditJobPopOut = ({
+ details,
+ onClose,
+ situation,
+ country,
+ categories,
+}) => {
+ const dispatch = useDispatch();
let [requestStatus, setRequestStatus] = useState({
loading: false,
@@ -54,8 +59,11 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
description: details?.description,
job_detail: details?.job_detail,
timeline_days: details?.timeline_days,
+ category: details?.category
};
+ console.log("This is the init values for edit job",initialValues)
+
const jobApi = useMemo(() => new usersService(), []);
const navigate = useNavigate();
@@ -67,14 +75,14 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
job_uid: details.job_uid,
...values,
};
- delete reqData?.country
+ delete reqData?.country;
try {
let res = await jobApi.jobManagerUpdateJob(reqData);
let { data } = await res;
if (data?.internal_return < 0) return;
setRequestStatus({ loading: false, message: null });
setTimeout(() => {
- dispatch(tableReload({type:'JOBTABLE'}))
+ dispatch(tableReload({ type: "JOBTABLE" }));
navigate("/myjobs", { replace: true });
onClose();
}, 1000);
@@ -129,7 +137,7 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {