BOD-17 Added Contracts list page + updates and bugfixes on other pages.
This commit is contained in:
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user