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 OwnerDetailUpdateJobsComponent({
|
||||
owner,
|
||||
selectedJobs,
|
||||
disabled
|
||||
disabled,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [updateJobs] = useMutation(UPDATE_JOBS);
|
||||
const handlecClick = e => {
|
||||
const handlecClick = (e) => {
|
||||
logImEXEvent("owner_update_jobs", { count: selectedJobs.length });
|
||||
|
||||
updateJobs({
|
||||
variables: {
|
||||
jobIds: selectedJobs,
|
||||
@@ -28,16 +31,16 @@ export default function OwnerDetailUpdateJobsComponent({
|
||||
ownr_ph2: owner["ownr_ph2"],
|
||||
ownr_st: owner["ownr_st"],
|
||||
ownr_title: owner["ownr_title"],
|
||||
ownr_zip: owner["ownr_zip"]
|
||||
}
|
||||
}
|
||||
ownr_zip: owner["ownr_zip"],
|
||||
},
|
||||
},
|
||||
})
|
||||
.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