Files
gg-backend/frontend/src/api/appointment.ts
T

27 lines
609 B
TypeScript
Raw Normal View History

2026-05-26 15:48:01 +05:30
import apiClient from '@/api/client';
2026-03-19 13:12:04 +05:30
export const getAppointmentsApi = async (
page = 1,
limit = 10,
2026-05-26 15:48:01 +05:30
date = '',
startDate = '',
endDate = '',
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 }),
...(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;
};