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

23 lines
512 B
TypeScript

import apiClient from "@/api/client";
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;
};
export const deleteAppointmentApi = async (id: number) => {
const res = await apiClient.delete(`/appointments/${id}`);
return res.data;
};