import { post } from "../config/request";

export const addBanding = async ({ noSanksi, ptId }, data) => {
	try {
		const res = await post(`/banding/add?noSanksi=${noSanksi}&ptId=${ptId}`, data);
		console.log(res);
		// addLog({ status: "SUCCESS", action: "CREATE", from: { id: result.added._id, data: "banding" }, description: "membuat permohonan banding" });
		return res.data;
	} catch (error) {
		console.log("error", error);
		// addLog({ status: "FAIL", action: "ADD", from: { data: "banding" }, description: error.message || "membuat permohonan banding" });
		return false;
	}
};

export const addJawabanBanding = async ({ noSanksi, ptId }, data) => {
	try {
		const res = await post(`/banding/jawaban/add?noSanksi=${noSanksi}&ptId=${ptId}`, data);
		console.log(res);
		// addLog({ status: "SUCCESS", action: "CREATE", from: { id: result.added._id, data: "banding" }, description: "membuat permohonan banding" });
		return res.data;
	} catch (error) {
		console.log("error", error);
		// addLog({ status: "FAIL", action: "ADD", from: { data: "banding" }, description: error.message || "membuat permohonan banding" });
		return false;
	}
};
