notification.js 360 B

1234567891011121314
  1. import api from "src/api";
  2. export const getNotifications = async () => {
  3. const { data } = await api.get("/notifications");
  4. return data.payload;
  5. };
  6. export const markNotificationAsRead = async (id) => {
  7. await api.put(`/notifications/${id}/read`);
  8. };
  9. export const markAllNotificationsAsRead = async () => {
  10. await api.put("/notifications/read-all");
  11. };