feat: add pagination in appointment

This commit is contained in:
ARJUN S THAMPI
2026-03-27 12:09:46 +05:30
parent 661bf7a77f
commit c6a041ac10
3 changed files with 289 additions and 139 deletions
+17 -2
View File
@@ -1,7 +1,22 @@
import apiClient from "@/api/client";
export const getAppointmentsApi = async () => {
const res = await apiClient.get("/appointments/getall");
export const getAppointmentsApi = async (
page?: number,
limit?: number,
search?: string,
doctor?: string,
department?: string,
date?: string,
) => {
let url = "/appointments/getAll";
if (page && limit) {
url += `?page=${page}&limit=${limit}&search=${search || ""}&doctor=${
doctor || ""
}&department=${department || ""}&date=${date || ""}`;
}
const res = await apiClient.get(url);
return res.data;
};