import { withHeaders } from "@/record-management/services/api/withHeaders";
import { AxiosResponse } from "axios";
import recordAxiosInstance from "./recordAxiosInstance";

interface params {
    take: number;
    skip: number;
    orderBy?:string;
}

export const getAllNotification =async(
    params: params
):Promise<AxiosResponse>=>{
    return recordAxiosInstance.get("/notifications", {
      params: params,
      headers: withHeaders(),
    });

}

export const getUnSeenNotification = async(
    params: params
):Promise<AxiosResponse>=>{
    return recordAxiosInstance.get("/notifications/unseen", {
      params: params,
      headers: withHeaders(),
    });
}

export const readNotification = (
    id:string
):Promise<AxiosResponse>=>{
    return recordAxiosInstance.post(
      `/notifications/${id}/read`,
      {},
      { headers: withHeaders() }
    );
}
