27 lines
609 B
TypeScript
27 lines
609 B
TypeScript
import apiClient from '@/api/client';
|
|
|
|
export const getAppointmentsApi = async (
|
|
page = 1,
|
|
limit = 10,
|
|
date = '',
|
|
startDate = '',
|
|
endDate = '',
|
|
search = ''
|
|
) => {
|
|
const params = new URLSearchParams({
|
|
page: String(page),
|
|
limit: String(limit),
|
|
...(date && { date }),
|
|
...(startDate && { startDate }),
|
|
...(endDate && { endDate }),
|
|
...(search && { search }),
|
|
});
|
|
const res = await apiClient.get(`/appointments/getall?${params}`);
|
|
return res.data;
|
|
};
|
|
|
|
export const deleteAppointmentApi = async (id: number) => {
|
|
const res = await apiClient.delete(`/appointments/${id}`);
|
|
return res.data;
|
|
};
|