Reformat all project files to use the prettier config file.
This commit is contained in:
@@ -1,66 +1,63 @@
|
||||
import axios from "axios";
|
||||
import React, {useEffect} from "react";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {setPartnerVersion} from "../../redux/application/application.actions";
|
||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||
import {store} from '../../redux/store'
|
||||
import React, { useEffect } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { setPartnerVersion } from "../../redux/application/application.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { store } from "../../redux/store";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
setPartnerVersion: (version) => dispatch(setPartnerVersion(version)),
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
setPartnerVersion: (version) => dispatch(setPartnerVersion(version))
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(PartnerPingComponent);
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(PartnerPingComponent);
|
||||
|
||||
export function PartnerPingComponent({bodyshop,}) {
|
||||
useEffect(() => {
|
||||
// Create an scoped async function in the hook
|
||||
export function PartnerPingComponent({ bodyshop }) {
|
||||
useEffect(() => {
|
||||
// Create an scoped async function in the hook
|
||||
|
||||
// Execute the created function directly
|
||||
checkPartnerStatus(bodyshop);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [bodyshop]);
|
||||
// Execute the created function directly
|
||||
checkPartnerStatus(bodyshop);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [bodyshop]);
|
||||
|
||||
return <></>;
|
||||
return <></>;
|
||||
}
|
||||
|
||||
export async function checkPartnerStatus(bodyshop) {
|
||||
if (!bodyshop) return;
|
||||
try {
|
||||
//if (process.env.NODE_ENV === "development") return;
|
||||
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
|
||||
// const {
|
||||
// appver, //qbpath
|
||||
// } = PartnerResponse.data;
|
||||
console.log(PartnerResponse.data)
|
||||
store.dispatch(setPartnerVersion(PartnerResponse.data));
|
||||
// if (
|
||||
// checkAcctPath &&
|
||||
// !qbpath &&
|
||||
// !(
|
||||
// bodyshop &&
|
||||
// (bodyshop.cdk_dealerid ||
|
||||
// bodyshop.pbs_serialnumber ||
|
||||
// bodyshop.accountingconfig.qbo)
|
||||
// )
|
||||
// ) {
|
||||
// notification["error"]({
|
||||
// title: "",
|
||||
// message: i18n.t("general.messages.noacctfilepath"),
|
||||
// });
|
||||
// }
|
||||
} catch (error) {
|
||||
console.log("Partner is not running.", error);
|
||||
// notification["error"]({
|
||||
// title: "",
|
||||
// message: i18n.t("general.messages.partnernotrunning"),
|
||||
// });
|
||||
}
|
||||
if (!bodyshop) return;
|
||||
try {
|
||||
//if (process.env.NODE_ENV === "development") return;
|
||||
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
|
||||
// const {
|
||||
// appver, //qbpath
|
||||
// } = PartnerResponse.data;
|
||||
console.log(PartnerResponse.data);
|
||||
store.dispatch(setPartnerVersion(PartnerResponse.data));
|
||||
// if (
|
||||
// checkAcctPath &&
|
||||
// !qbpath &&
|
||||
// !(
|
||||
// bodyshop &&
|
||||
// (bodyshop.cdk_dealerid ||
|
||||
// bodyshop.pbs_serialnumber ||
|
||||
// bodyshop.accountingconfig.qbo)
|
||||
// )
|
||||
// ) {
|
||||
// notification["error"]({
|
||||
// title: "",
|
||||
// message: i18n.t("general.messages.noacctfilepath"),
|
||||
// });
|
||||
// }
|
||||
} catch (error) {
|
||||
console.log("Partner is not running.", error);
|
||||
// notification["error"]({
|
||||
// title: "",
|
||||
// message: i18n.t("general.messages.partnernotrunning"),
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user