header and notification

This commit is contained in:
hamid zarghami
2025-07-20 10:12:31 +03:30
parent 27fc6b765c
commit 4f3976bfe8
17 changed files with 677 additions and 102 deletions
@@ -0,0 +1,18 @@
import axios from "../../../config/axios";
export const getNotifications = async (
page: number,
status: "all" | "read" | "unread"
) => {
let query = ``;
if (status !== "all") {
query = `&isRead=${status === "read" ? 1 : 0}`;
}
const { data } = await axios.get(`/notifications?page=${page}${query}`);
return data;
};
export const readAll = async () => {
const { data } = await axios.patch(`/notifications/read-all`);
return data;
};