diff --git a/client/src/components/job-tombstone/job-tombstone.component.jsx b/client/src/components/job-tombstone/job-tombstone.component.jsx index e546deeb2..03bef3666 100644 --- a/client/src/components/job-tombstone/job-tombstone.component.jsx +++ b/client/src/components/job-tombstone/job-tombstone.component.jsx @@ -1,9 +1,12 @@ import React, { useState } from "react"; import AlertComponent from "../alert/alert.component"; import { Form, Input, Row, Col, Button } from "antd"; +import { UPDATE_JOB } from "../../graphql/jobs.queries"; +import { useMutation } from "@apollo/react-hooks"; function JobTombstone({ job, ...otherProps }) { const [jobContext, setJobContext] = useState(job); + const [mutationUpdateJob] = useMutation(UPDATE_JOB); if (!job) { return ( @@ -20,6 +23,10 @@ function JobTombstone({ job, ...otherProps }) { otherProps.form.validateFieldsAndScroll((err, values) => { if (!err) { console.log("Received values of form: ", values); + + mutationUpdateJob({ + variables: { jobId: jobContext.id, job: JSON.stringify(values) } + }).then(r => console.log("result", r)); } }); }; @@ -27,10 +34,8 @@ function JobTombstone({ job, ...otherProps }) { const handleChange = event => { const { name, value } = event.target; setJobContext({ ...jobContext, [name]: value }); - console.log("jobContext", jobContext); }; - console.log("#DEBUG", job); const { getFieldDecorator } = otherProps.form; return (