Added first round of analytics and event tracking BOD-190
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import ShopEmployeeComponent from "./shop-employees.component";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -30,6 +31,8 @@ function ShopEmployeesContainer({ bodyshop }) {
|
||||
const [insertEmployees] = useMutation(INSERT_EMPLOYEES);
|
||||
const [deleteEmployee] = useMutation(DELETE_EMPLOYEE);
|
||||
const handleDelete = (id) => {
|
||||
logImEXEvent("shop_employee_delete");
|
||||
|
||||
deleteEmployee({ variables: { id: id } })
|
||||
.then((r) => {
|
||||
notification["success"]({
|
||||
@@ -52,6 +55,8 @@ function ShopEmployeesContainer({ bodyshop }) {
|
||||
console.log("values", values);
|
||||
if (employeeState[0].id) {
|
||||
//Update a record.
|
||||
logImEXEvent("shop_employee_update");
|
||||
|
||||
updateEmployee({
|
||||
variables: { id: employeeState[0].id, employee: values },
|
||||
})
|
||||
@@ -72,6 +77,8 @@ function ShopEmployeesContainer({ bodyshop }) {
|
||||
});
|
||||
} else {
|
||||
//New record, insert it.
|
||||
logImEXEvent("shop_employee_insert");
|
||||
|
||||
insertEmployees({
|
||||
variables: { employees: [{ ...values, shopid: bodyshop.id }] },
|
||||
}).then((r) => {
|
||||
|
||||
Reference in New Issue
Block a user