log.js 905 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 getLogPT = async (token) => {
  18. try {
  19. let url = `/pemantauan/pt`;
  20. const res = await axios.get(url, {
  21. headers: {
  22. Authorization: token,
  23. },
  24. });
  25. return res.data;
  26. } catch (error) {
  27. console.log("error", error);
  28. return false;
  29. }
  30. };
  31. export const getLogPublic = async ({ no_hp, no_laporan }) => {
  32. try {
  33. const res = await axios.get(`/public/pemantauan?no_hp=${no_hp}&no_laporan=${no_laporan}`);
  34. return res.data;
  35. } catch (error) {
  36. console.log("error", error);
  37. return false;
  38. }
  39. };