moved user joblist into it's own slice, to avoid unneccessary side menu display recalculation

This commit was merged in pull request #121.
This commit is contained in:
victorAnumudu
2023-05-30 07:29:57 +01:00
parent 577212eb19
commit b2bfa6cd54
7 changed files with 89 additions and 46 deletions
+6 -1
View File
@@ -4,7 +4,9 @@ import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import usersService from "../../services/UsersService";
import { useSelector } from "react-redux";
import { useSelector, useDispatch } from "react-redux";
import { tableReload } from '../../store/TableReloads'
import { Field, Form, Formik } from "formik";
import * as Yup from "yup";
@@ -40,6 +42,8 @@ function AddJob() {
const ApiCall = new usersService();
const navigate = useNavigate();
let dispatch = useDispatch()
let { userDetails } = useSelector((state) => state.userDetails);
let [pageLoading, setPageLoading] = useState(true); // State used for knowing when the page is mounting
@@ -105,6 +109,7 @@ function AddJob() {
message: "Job Added Successfully",
});
setTimeout(() => {
dispatch(tableReload({type:'JOBTABLE'}))
navigate("/myjobs", { replace: true });
}, 1000);
})