Files
gg-backend/frontend/src/api/appointment.ts
T
2026-05-26 15:48:01 +05:30

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;
};