| 123456789101112131415161718192021222324252627282930313233343536373839 | import { get, post, del, put } from "../config/request";import axiosAPI from "../config/axios";import { createLog } from "./log";import { getCsrf } from "./security";export const addPesertaPleno = async (token, data) => {    const getToken = await getCsrf();    const _csrf = getToken.token;    try {        const res = await axiosAPI.post(`/public/sanksi/add-peserta-pleno?_csrf=${_csrf}`, 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;    }};
 |