diff --git a/client/src/components/schedule-calendar/schedule-calendar.component.jsx b/client/src/components/schedule-calendar/schedule-calendar.component.jsx index 222be1e3a..1c9463e23 100644 --- a/client/src/components/schedule-calendar/schedule-calendar.component.jsx +++ b/client/src/components/schedule-calendar/schedule-calendar.component.jsx @@ -21,6 +21,7 @@ import ScheduleVerifyIntegrity from "../schedule-verify-integrity/schedule-verif import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import _ from "lodash"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -44,16 +45,19 @@ export function ScheduleCalendarComponent({ data, refetch, bodyshop }) { [] ); - const estimators = useMemo( - () => - data + const estimators = useMemo(() => { + return _.uniq([ + ...data .filter((d) => d.__typename === "appointments") .map((app) => `${app.job?.est_ct_fn || ""} ${app.job?.est_ct_ln || ""}`.trim() ) .filter((e) => e.length > 0), - [data] - ); + ...bodyshop.md_estimators.map((e) => + `${e.est_ct_fn || ""} ${e.est_ct_ln || ""}`.trim() + ), + ]); + }, [data, bodyshop.md_estimators]); const filteredData = useMemo(() => { return data.filter((d) => {