Files
edr-platform/apps/edr-freight-web/backoffice/src/shared/services/notificationService.ts
natib21 e6e44e773b fix ui
2026-07-10 11:25:59 +00:00

39 lines
912 B
TypeScript

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() }
);
}