fix:memperbaiki toast pada beranda
This commit is contained in:
parent
7ee70a8a9f
commit
cdf9a4ddb3
|
@ -55,7 +55,7 @@ const ViewGrafik = ({ date, setDate, dataYAxis, setDataYAxis, priceType, setPric
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`${API_URL}/predict/date`);
|
const response = await axios.get(`${API_URL}/predict/date`);
|
||||||
|
|
||||||
console.log(response.data.tanggal_old)
|
// console.log(response.data.tanggal_old)
|
||||||
setDateTerbaru(response.data.tanggal_new)
|
setDateTerbaru(response.data.tanggal_new)
|
||||||
setDateTerlama(response.data.tanggal_old)
|
setDateTerlama(response.data.tanggal_old)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -69,9 +69,9 @@ const ViewGrafik = ({ date, setDate, dataYAxis, setDataYAxis, priceType, setPric
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
|
|
||||||
const formattedDate = format(date, "yyyy-MM-dd");
|
|
||||||
|
|
||||||
if (!date && !tempPriceType) {
|
|
||||||
|
if (!!date && !!tempPriceType) {
|
||||||
|
|
||||||
setTabelDataAktual([]);
|
setTabelDataAktual([]);
|
||||||
setTabelDataPredict([]);
|
setTabelDataPredict([]);
|
||||||
|
@ -101,6 +101,9 @@ const ViewGrafik = ({ date, setDate, dataYAxis, setDataYAxis, priceType, setPric
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formattedDate = format(date, "yyyy-MM-dd");
|
||||||
|
console.log(tempPriceType);
|
||||||
|
|
||||||
|
|
||||||
if (formattedDate==dateTerbaru && tempPriceType=="all") {
|
if (formattedDate==dateTerbaru && tempPriceType=="all") {
|
||||||
|
|
||||||
|
@ -148,7 +151,6 @@ const ViewGrafik = ({ date, setDate, dataYAxis, setDataYAxis, priceType, setPric
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`${API_URL}/predict/history?tanggal=${formattedDate}&data_type=${tempPriceType}`);
|
const response = await axios.get(`${API_URL}/predict/history?tanggal=${formattedDate}&data_type=${tempPriceType}`);
|
||||||
const formattedData = response.data.dataGrafik.map(item => ({
|
const formattedData = response.data.dataGrafik.map(item => ({
|
||||||
|
|
Loading…
Reference in New Issue