BOD-17 Added Contracts list page + updates and bugfixes on other pages.

This commit is contained in:
Patrick Fic
2020-04-01 10:48:53 -07:00
parent 28f443277b
commit 2a1cb3fb9f
15 changed files with 253 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ import { Form, notification } from "antd";
import { useTranslation } from "react-i18next";
import { INSERT_NEW_CONTRACT } from "../../graphql/cccontracts.queries";
import { useMutation } from "@apollo/react-hooks";
import { useHistory } from "react-router-dom";
import { useHistory, useLocation } from "react-router-dom";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
});
@@ -16,10 +16,15 @@ const mapStateToProps = createStructuredSelector({
export function ContractCreatePageContainer({ bodyshop }) {
const [form] = Form.useForm();
const { t } = useTranslation();
const selectedCarState = useState(null);
const selectedJobState = useState(null);
const [insertContract] = useMutation(INSERT_NEW_CONTRACT);
const history = useHistory();
const location = useLocation();
const selectedCarState = useState(null);
const selectedJobState = useState(
(location.state && location.state.jobId) || null
);
const [insertContract] = useMutation(INSERT_NEW_CONTRACT);
console.log("location", location);
const handleFinish = values => {
if (!!selectedCarState[0] && !!selectedJobState[0]) {