IO-233 CDK Updates.

This commit is contained in:
Patrick Fic
2021-12-02 15:51:21 -08:00
parent 8d3c2f7af6
commit a5aee28d42
5 changed files with 68 additions and 37 deletions

View File

@@ -4,9 +4,12 @@ import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
currentUser: selectCurrentUser,
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
@@ -14,9 +17,12 @@ const mapDispatchToProps = (dispatch) => ({
});
export default connect(mapStateToProps, mapDispatchToProps)(DmsCdkMakesRefetch);
export function DmsCdkMakesRefetch({ bodyshop, form, socket }) {
export function DmsCdkMakesRefetch({ currentUser, bodyshop, form, socket }) {
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
if (!currentUser.email.includes("@imex.")) return null;
const handleRefetch = async () => {
setLoading(true);
await axios.post("/cdk/getvehicles", {