import axios from "../config/axios";
import { createLog } from "./log";

export const addDocPerbaikan = async (token, id, data) => {
	try {
		const res = await axios.post(`/sanksi/perbaikan/add/${id}`, data, { headers: { Authorization: token } });
		await createLog(token, { aktivitas: `Berhasil melakukan perbaikan dokumen, id: ${id}` });
		return res.data;
	} catch (error) {
		console.log("error", error);
		await createLog(token, { aktivitas: `Gagal melakukan perbaikan dokumen, id: ${id}` });
		return false;
	}
};
