import { get } from "../config/request"; export const getPelanggaranId = async (id) => { try { const data = { id }; const myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); const raw = JSON.stringify(data); const requestOptions = { method: "POST", body: raw, headers: myHeaders, }; const res = await get("/pelanggaran", requestOptions); return await res.data; } catch (error) { console.log("error", error); return false; } }; export const getPelanggaran = async () => { try { const res = await get("/pelanggaran"); return await res.data; } catch (error) { console.log("error", error); return false; } };