log.js 537 B

123456789101112131415161718192021222324
  1. import { get } from "../config/request";
  2. export const getLog = async ({ ptId, isPT }) => {
  3. try {
  4. let url = `/log?ptId=${ptId}`;
  5. if (isPT) url += `&isPT=true`;
  6. const res = await get(url);
  7. return res.data;
  8. } catch (error) {
  9. console.log("error", error);
  10. return false;
  11. }
  12. };
  13. export const getLogPublic = async ({ ptId, laporanId }) => {
  14. try {
  15. let url = `/log/public?ptId=${ptId}&laporan=${laporanId}`;
  16. const res = await get(url);
  17. return res.data;
  18. } catch (error) {
  19. console.log("error", error);
  20. return false;
  21. }
  22. };