andi 3 éve
szülő
commit
286ff0955a
2 módosított fájl, 23 hozzáadás és 23 törlés
  1. 16 16
      components/Riwayat/ChartDataBar.js
  2. 7 7
      pages/app/riwayat/index.js

+ 16 - 16
components/Riwayat/ChartDataBar.js

@@ -70,25 +70,25 @@ class ChartDataBar extends React.Component {
 		};
 	}
 
-	// async componentDidMount() {
-	// 	const { token } = this.props;
-	// 	const data = await jumlahLaporan(token);
-	// 	this.setState((prevState) => ({
-	// 		...prevState,
-	// 		series: [{ data: data.data.map((e) => e.jumlah_laporan), name: "jumlah laporan" }],
-	// 		options: {
-	// 			...prevState.options,
-	// 			xaxis: {
-	// 				categories: data.data.map((e) => e._id),
-	// 			},
-	// 		},
-	// 	}));
-	// }
 	async componentDidMount() {
 		const { token } = this.props;
-		const data = await getjumlahStatusLaporan(token);
-		// console.log(data.data);
+		const data = await jumlahLaporan(token);
+		this.setState((prevState) => ({
+			...prevState,
+			series: [{ data: data.data.map((e) => e.jumlah_laporan), name: "jumlah laporan" }],
+			options: {
+				...prevState.options,
+				xaxis: {
+					categories: data.data.map((e) => e._id),
+				},
+			},
+		}));
 	}
+	// async componentDidMount() {
+	// 	const { token } = this.props;
+	// 	const data = await getjumlahStatusLaporan(token);
+	// 	// console.log(data.data);
+	// }
 
 	render() {
 		return (

+ 7 - 7
pages/app/riwayat/index.js

@@ -25,13 +25,13 @@ class Riwayat extends Component {
     };
   }
 
-  componentDidMount = async () => {
-    const { token } = this.props;
-    let jumlahStatusLaporan = await getjumlahStatusLaporan(token);
-    this.setState({ jumlahStatusLaporan });
-    // console.log(jumlahStatusLaporan.data[1].jumlah_jadwal_evaluasi);
-    // console.log(jumlahStatusLaporan);
-  };
+  // componentDidMount = async () => {
+  //   const { token } = this.props;
+  //   let jumlahStatusLaporan = await getjumlahStatusLaporan(token);
+  //   this.setState({ jumlahStatusLaporan });
+  //   console.log(jumlahStatusLaporan.data[1].jumlah_jadwal_evaluasi);
+  //   console.log(jumlahStatusLaporan);
+  // };
 
   render() {
     return (