2026-03-19 13:12:04 +05:30
|
|
|
import apiClient from "@/api/client";
|
|
|
|
|
|
2026-04-24 11:40:14 +05:30
|
|
|
export const getAppointmentsApi = async (
|
|
|
|
|
page = 1,
|
|
|
|
|
limit = 10,
|
|
|
|
|
date = "",
|
2026-05-13 14:20:51 +05:30
|
|
|
startDate = "",
|
|
|
|
|
endDate = "",
|
2026-04-24 11:40:14 +05:30
|
|
|
search = "",
|
|
|
|
|
) => {
|
|
|
|
|
const params = new URLSearchParams({
|
|
|
|
|
page: String(page),
|
|
|
|
|
limit: String(limit),
|
|
|
|
|
...(date && { date }),
|
2026-05-13 14:20:51 +05:30
|
|
|
...(startDate && { startDate }),
|
|
|
|
|
...(endDate && { endDate }),
|
2026-04-24 11:40:14 +05:30
|
|
|
...(search && { search }),
|
|
|
|
|
});
|
|
|
|
|
const res = await apiClient.get(`/appointments/getall?${params}`);
|
2026-03-19 13:12:04 +05:30
|
|
|
return res.data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const deleteAppointmentApi = async (id: number) => {
|
|
|
|
|
const res = await apiClient.delete(`/appointments/${id}`);
|
|
|
|
|
return res.data;
|
|
|
|
|
};
|