WIP Fortellis.
This commit is contained in:
@@ -17,7 +17,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(DmsCustomerSelector);
|
||||
|
||||
export function DmsCustomerSelector({ bodyshop }) {
|
||||
export function DmsCustomerSelector({ bodyshop, jobid }) {
|
||||
const { t } = useTranslation();
|
||||
const [customerList, setcustomerList] = useState([]);
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -38,7 +38,7 @@ export function DmsCustomerSelector({ bodyshop }) {
|
||||
if (Fortellis.treatment === "on") {
|
||||
const handleFortellisSelectCustomer = (customerList, callback) => {
|
||||
setOpen(true);
|
||||
setDmsType("fortellis");
|
||||
setDmsType("cdk");
|
||||
setcustomerList(customerList);
|
||||
};
|
||||
wsssocket.on("fortellis-select-customer", handleFortellisSelectCustomer);
|
||||
@@ -67,7 +67,11 @@ export function DmsCustomerSelector({ bodyshop }) {
|
||||
|
||||
const onUseSelected = () => {
|
||||
setOpen(false);
|
||||
socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
|
||||
if (Fortellis.treatment === "on") {
|
||||
wsssocket.emit(`fortellis-selected-customer`, { selectedCustomerId: selectedCustomer, jobid });
|
||||
} else {
|
||||
socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
|
||||
}
|
||||
setSelectedCustomer(null);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user