import { api } from "@/config/axios";
import { NotificationsResponse } from "../types/Types";
import { BaseResponse } from "@/app/[name]/(Main)/types/Types";

export const getNotifications = async (): Promise<NotificationsResponse> => {
  const { data } = await api.get<NotificationsResponse>(
    "/public/notifications?status=unseen"
  );
  return data;
};

export const deleteNotification = async (
  id: string
): Promise<BaseResponse<unknown>> => {
  const { data } = await api.delete<BaseResponse<unknown>>(
    `/public/notifications/${id}`
  );
  return data;
};

export const readAll = async () => {
  const { data } = await api.put("/public/notifications/read/all");
  return data;
};
