feat: server-side pagination, search, and date filter for appointments

This commit is contained in:
Kailasdevdas
2026-04-24 11:40:14 +05:30
parent 51d604d6ee
commit 65e6413129
3 changed files with 97 additions and 53 deletions
+13 -2
View File
@@ -1,7 +1,18 @@
import apiClient from "@/api/client";
export const getAppointmentsApi = async () => {
const res = await apiClient.get("/appointments/getall");
export const getAppointmentsApi = async (
page = 1,
limit = 10,
date = "",
search = "",
) => {
const params = new URLSearchParams({
page: String(page),
limit: String(limit),
...(date && { date }),
...(search && { search }),
});
const res = await apiClient.get(`/appointments/getall?${params}`);
return res.data;
};