Added first round of analytics and event tracking BOD-190
This commit is contained in:
@@ -3,15 +3,18 @@ import { Button, notification } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMutation } from "@apollo/react-hooks";
|
||||
import { UPDATE_JOBS } from "../../graphql/jobs.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
export default function VehicleDetailUpdateJobsComponent({
|
||||
vehicle,
|
||||
selectedJobs,
|
||||
disabled
|
||||
disabled,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [updateJobs] = useMutation(UPDATE_JOBS);
|
||||
const handlecClick = e => {
|
||||
const handlecClick = (e) => {
|
||||
logImEXEvent("vehicle_update_jobs");
|
||||
|
||||
updateJobs({
|
||||
variables: {
|
||||
jobIds: selectedJobs,
|
||||
@@ -22,16 +25,16 @@ export default function VehicleDetailUpdateJobsComponent({
|
||||
v_model_yr: vehicle["v_model_yr"],
|
||||
v_model_desc: vehicle["v_model_desc"],
|
||||
v_make_desc: vehicle["v_make_desc"],
|
||||
v_color: vehicle["v_color"]
|
||||
}
|
||||
}
|
||||
v_color: vehicle["v_color"],
|
||||
},
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
.then((response) => {
|
||||
notification["success"]({ message: t("jobs.successes.updated") });
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.updating", { error: JSON.stringify(error) })
|
||||
message: t("jobs.errors.updating", { error: JSON.stringify(error) }),
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user