yazid138 3 years ago
parent
commit
501084dfa6
2 changed files with 7 additions and 7 deletions
  1. 5 5
      actions/pelanggaran.js
  2. 2 2
      components/Main/DetailLaporan.js

+ 5 - 5
actions/pelanggaran.js

@@ -1,4 +1,4 @@
-import { get } from "../config/request";
+import { API_URL } from "@/env";
 
 export const getPelanggaranId = async (id) => {
 	try {
@@ -14,8 +14,8 @@ export const getPelanggaranId = async (id) => {
 			headers: myHeaders,
 		};
 
-		const res = await get("/pelanggaran", requestOptions);
-		return await res.data;
+		const res = await fetch(API_URL + "/pelanggaran", requestOptions);
+		return await res.json();
 	} catch (error) {
 		console.log("error", error);
 		return false;
@@ -24,8 +24,8 @@ export const getPelanggaranId = async (id) => {
 
 export const getPelanggaran = async () => {
 	try {
-		const res = await get("/pelanggaran");
-		return await res.data;
+		const res = await fetch(API_URL + "/pelanggaran");
+		return await res.json();
 	} catch (error) {
 		console.log("error", error);
 		return false;

+ 2 - 2
components/Main/DetailLaporan.js

@@ -41,7 +41,7 @@ function DetailLaporan({ data, noTitle = false, noStatus = false }) {
 								</Col>
 							</FormGroup>
 							<FormGroup row>
-								<Col md="4">Foto Identitas:</Col>
+								<Col md="4">Foto Kartu Identitas:</Col>
 								<Col md="8">
 									<img src={`data:${data.user_id.files[0].type};base64, ${Buffer.from(data.user_id.files[0].data).toString("base64")}`} height={200} alt="Foto Identitas" />
 								</Col>
@@ -59,7 +59,7 @@ function DetailLaporan({ data, noTitle = false, noStatus = false }) {
 					</Col>
 				</FormGroup>
 				<FormGroup row>
-					<Col md="4">Nama Perguruan Tinggi:</Col>
+					<Col md="4">Nama Perguruan Tinggi yang Dilaporkan:</Col>
 					<Col md="8">
 						<strong>{data.pt.nama}</strong>
 					</Col>