import { get } from "../config/request";
import axios from "@/config/axios";

export const getLog = async (token, laporan_id) => {
	try {
		let url = `/pemantauan/${laporan_id}`;
		const res = await axios.get(url, {
			headers: {
				Authorization: token,
			},
		});
		return res.data;
	} catch (error) {
		console.log("error", error);
		return false;
	}
};

export const getLogPT = async (token) => {
	try {
		let url = `/pemantauan/pt`;
		const res = await axios.get(url, {
			headers: {
				Authorization: token,
			},
		});
		return res.data;
	} catch (error) {
		console.log("error", error);
		return false;
	}
};

export const getLogPublic = async ({ no_hp, no_laporan }) => {
	try {
		const res = await axios.get(`/public/pemantauan?no_hp=${no_hp}&no_laporan=${no_laporan}`);
		return res.data;
	} catch (error) {
		console.log("error", error);
		return false;
	}
};
