IO-2151 Resolve issue removing CSR on conversion.

This commit is contained in:
Patrick Fic
2023-01-26 11:24:53 -08:00
parent d89acbd49d
commit 25513ae5b5
2 changed files with 11 additions and 27 deletions

View File

@@ -43,14 +43,21 @@ export function JobsConvertButton({
const { t } = useTranslation();
const [form] = Form.useForm();
const handleConvert = async (values) => {
const handleConvert = async ({ employee_csr, ...values }) => {
if (parentFormIsFieldsTouched()) {
alert(t("jobs.labels.savebeforeconversion"));
return;
}
setLoading(true);
const res = await mutationConvertJob({
variables: { jobId: job.id, ...values },
variables: {
jobId: job.id,
job: {
converted: true,
...(bodyshop.enforce_conversion_csr ? { employee_csr } : {}),
...values,
},
},
});
if (values.ca_gst_registrant) {