import { get, post, del, put } from "../config/request"; import axiosAPI from "../config/axios"; import { createLog } from "./log"; export const addPesertaPleno = async (token, data) => { try { const res = await axiosAPI.post('/public/sanksi/add-peserta-pleno', data, { headers: { Authorization: token } }); return res.data; } catch (error) { console.log("error", error.response.data); return false; } }; export const getOneLaporanPublic = async (id, query = {}) => { try { let url = `public/laporan/${id}`; if (query != null) { const { aktif, all } = query; url += "?"; const parseURL = []; if (all) { parseURL.push(`all=true`); } if (aktif === false) { parseURL.push(`aktif=false`); } url += parseURL.join("&"); } const res = await axiosAPI.get(url); return res.data; } catch (error) { console.log("error", error); return false; } };