BOD-52 #comment Implemented job updating based on owner fields. Currently, which fields are updated are hardcoded.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import React from "react";
|
||||
import { Button } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "@apollo/react-hooks";
|
||||
import { UPDATE_JOBS } from "../../graphql/jobs.queries";
|
||||
|
||||
export default function OwnerDetailUpdateJobsComponent({
|
||||
owner,
|
||||
selectedJobs
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [updateJobs] = useMutation(UPDATE_JOBS);
|
||||
const handlecClick = e => {
|
||||
updateJobs({
|
||||
variables: {
|
||||
jobIds: selectedJobs,
|
||||
fields: {
|
||||
ownr_addr1: owner["ownr_addr1"],
|
||||
ownr_addr2: owner["ownr_addr2"],
|
||||
ownr_co_nm: owner["ownr_co_nm"],
|
||||
ownr_city: owner["ownr_city"],
|
||||
ownr_ctry: owner["ownr_ctry"],
|
||||
ownr_ea: owner["ownr_ea"],
|
||||
ownr_fn: owner["ownr_fn"],
|
||||
ownr_ph1: owner["ownr_ph1"],
|
||||
ownr_ln: owner["ownr_ln"],
|
||||
ownr_ph2: owner["ownr_ph2"],
|
||||
ownr_st: owner["ownr_st"],
|
||||
ownr_title: owner["ownr_title"],
|
||||
ownr_zip: owner["ownr_zip"]
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return <Button onClick={handlecClick}>{t("owners.actions.update")}</Button>;
|
||||
}
|
||||
Reference in New Issue
Block a user