From 845b7cfd0514438bcd8572b5e799539427db8b7c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 19 Apr 2021 10:03:31 -0700 Subject: [PATCH] Minor Code Updates --- .../bill-form/bill-form.totals.utility.js | 3 --- ...bs-detail-header-actions.csi.component.jsx | 26 ++++++++++--------- server/job/job-costing.js | 2 -- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/client/src/components/bill-form/bill-form.totals.utility.js b/client/src/components/bill-form/bill-form.totals.utility.js index 25909d549..11cb7c481 100644 --- a/client/src/components/bill-form/bill-form.totals.utility.js +++ b/client/src/components/bill-form/bill-form.totals.utility.js @@ -1,9 +1,6 @@ import Dinero from "dinero.js"; -import { logImEXEvent } from "../../firebase/firebase.utils"; export const CalculateBillTotal = (invoice) => { - logImEXEvent("invoice_calculate_total"); - const { total, billlines, diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx index 70a009a05..f898fd311 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx @@ -1,24 +1,24 @@ -import { useMutation, useApolloClient } from "@apollo/client"; +import { useApolloClient, useMutation } from "@apollo/client"; import { Menu, notification } from "antd"; +import parsePhoneNumber from "libphonenumber-js"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; -import { createStructuredSelector } from "reselect"; -import { - INSERT_CSI, - GET_CURRENT_QUESTIONSET_ID, -} from "../../graphql/csi.queries"; -import { selectBodyshop } from "../../redux/user/user.selectors"; -import { setEmailOptions } from "../../redux/email/email.actions"; -import { TemplateList } from "../../utils/TemplateConstants"; -import { logImEXEvent } from "../../firebase/firebase.utils"; -import { DateTimeFormatter } from "../../utils/DateFormatter"; import { Link } from "react-router-dom"; -import parsePhoneNumber from "libphonenumber-js"; +import { createStructuredSelector } from "reselect"; +import { logImEXEvent } from "../../firebase/firebase.utils"; +import { + GET_CURRENT_QUESTIONSET_ID, + INSERT_CSI, +} from "../../graphql/csi.queries"; +import { setEmailOptions } from "../../redux/email/email.actions"; import { openChatByPhone, setMessage, } from "../../redux/messaging/messaging.actions"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; +import { TemplateList } from "../../utils/TemplateConstants"; const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser' @@ -81,6 +81,8 @@ export function JobsDetailHeaderCsi({ }, }, }, + refetchQueries: ["GET_JOB_BY_PK"], + awaitRefetchQueries: true, }); if (!!!result.errors) { diff --git a/server/job/job-costing.js b/server/job/job-costing.js index d07c659f9..3beea43ca 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -3,7 +3,6 @@ const queries = require("../graphql-client/queries"); //const client = require("../graphql-client/graphql-client").client; const _ = require("lodash"); const GraphQLClient = require("graphql-request").GraphQLClient; -const { json } = require("body-parser"); // Dinero.defaultCurrency = "USD"; // Dinero.globalLocale = "en-CA"; @@ -90,7 +89,6 @@ async function JobCostingMulti(req, res) { (x) => x.cost_center === c.cost_center ); - console.log(`CostCenterIndex`, CostCenterIndex); if (CostCenterIndex >= 0) { //Add it in place multiSummary.costCenterData[CostCenterIndex] = {