Suppression bug affichage dashboard

master
Jeremy DUCOURTHIAL 3 years ago
parent df5a45f796
commit 1ee10f929f

@ -10,7 +10,7 @@ const api = axios.create({
function Dashboard() { function Dashboard() {
const [infoContactRecent, setInfoContactRecent] = useState([]); const [infoContactRecent, setInfoContactRecent] = useState([]);
const [datakey, setDataKey] = useState([]); const [dataKey, setDataKey] = useState([]);
const [infoBestCustomer, setinfoBestCustomer] = useState([]); const [infoBestCustomer, setinfoBestCustomer] = useState([]);
const [theme, setTheme] = useState("light"); const [theme, setTheme] = useState("light");
@ -28,17 +28,22 @@ function Dashboard() {
const apiString = '/Contact/LastAdd3/' + Session.get("idUser"); const apiString = '/Contact/LastAdd3/' + Session.get("idUser");
api.get(apiString).then((response) => { api.get(apiString).then((response) => {
if (response.data.length > 0)
setInfoContactRecent(response.data); setInfoContactRecent(response.data);
}); });
const apiStringKey = '/Sale/KeyNumber/' + Session.get("idUser") + "/" + month + "/" + year; const apiStringKey = '/Sale/KeyNumber/' + Session.get("idUser") + "/" + month + "/" + year;
api.get(apiStringKey).then((response) => { api.get(apiStringKey).then((response) => {
if (response.data.length > 0)
setDataKey(response.data[0]); setDataKey(response.data[0]);
}); });
const apiStringBestCustomer = '/Sale/BestCustomer/' + Session.get("idUser"); const apiStringBestCustomer = '/Sale/BestCustomer/' + Session.get("idUser");
api.get(apiStringBestCustomer).then((response) => { api.get(apiStringBestCustomer).then((response) => {
if (response.data.length > 0)
setinfoBestCustomer(response.data[0]); setinfoBestCustomer(response.data[0]);
else
setinfoBestCustomer({name :"Aucun client",total: "0"});
}); });
}, []); }, []);
@ -75,11 +80,11 @@ function Dashboard() {
<div className="Ch_Clé_gauche"> <div className="Ch_Clé_gauche">
<div className="Ch_Clé_gauche_haut"> <div className="Ch_Clé_gauche_haut">
Chiffre_clés Chiffre_clés
<div>{datakey.total}</div> <div>{dataKey.total}</div>
</div> </div>
<div className="Ch_Clé_gauche_bas"> <div className="Ch_Clé_gauche_bas">
Chiffre_clés Chiffre_clés
<div>{datakey.totalcontact}</div> <div>{dataKey.totalcontact}</div>
</div> </div>
</div> </div>
<div className="Ch_Clé_droite"> <div className="Ch_Clé_droite">

Loading…
Cancel
Save