log.js 598 B

12345678910111213141516171819202122232425262728
  1. import { get } from "../config/request";
  2. import axios from "@/config/axios";
  3. export const getLog = async (token, ptId) => {
  4. try {
  5. let url = `/pemantauan/${ptId}`;
  6. const res = await axios.get(url, {
  7. headers: {
  8. Authorization: token,
  9. },
  10. });
  11. return res.data;
  12. } catch (error) {
  13. console.log("error", error);
  14. return false;
  15. }
  16. };
  17. export const getLogPublic = async ({ ptId, laporanId }) => {
  18. try {
  19. let url = `/log/public?ptId=${ptId}&laporan=${laporanId}`;
  20. const res = await get(url);
  21. return res.data;
  22. } catch (error) {
  23. console.log("error", error);
  24. return false;
  25. }
  26. };