|
|
@@ -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;
|