import { addLog } from "./log";

export const addCabutSanksi = async ({ noSanksi, ptId }, data) => {
	try {
		const res = await fetch(`http://localhost:5000/cabut-sanksi/add?noSanksi=${noSanksi}&ptId=${ptId}`, {
			method: "POST",
			body: data,
		});
		const result = await res.json();
		console.log(result);
		return result;
	} catch (error) {
		console.log("error", error);
		return false;
	}
};

export const addJawabanCabutSanksi = async ({ noSanksi, ptId }, data) => {
	try {
		const res = await fetch(`http://localhost:5000/cabut-sanksi/jawaban/add?noSanksi=${noSanksi}&ptId=${ptId}`, {
			method: "POST",
			body: data,
		});
		const result = await res.json();
		console.log(result);
		return result;
	} catch (error) {
		console.log("error", error);
		return false;
	}
};
