notifikasi.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { get, post } from "@/config/request";
  2. import axios from "axios";
  3. const url = "http://rule.sidali.sixsenz.net";
  4. export const notifLaporanBaru = async (data) => {
  5. try {
  6. const response = await axios.post(url + "/notifikasi/laporan-baru", data);
  7. return response.data;
  8. } catch (error) {
  9. if (error.response?.data) return error.response.data;
  10. console.log(error);
  11. return false;
  12. }
  13. };
  14. export const notifKeberatan = async (data) => {
  15. try {
  16. const response = await axios.post(url + "/notifikasi/keberatan", data);
  17. return response.data;
  18. } catch (error) {
  19. if (error.response?.data) return error.response.data;
  20. console.log(error);
  21. return false;
  22. }
  23. };
  24. export const notifBanding = async (data) => {
  25. try {
  26. const response = await axios.post(url + "/notifikasi/banding", data);
  27. return response.data;
  28. } catch (error) {
  29. if (error.response?.data) return error.response.data;
  30. console.log(error);
  31. return false;
  32. }
  33. };
  34. export const notifDocPerbaikan = async (data) => {
  35. try {
  36. const response = await axios.post(url + "/notifikasi/doc-perbaikan", data);
  37. return response.data;
  38. } catch (error) {
  39. if (error.response?.data) return error.response.data;
  40. console.log(error);
  41. return false;
  42. }
  43. };