change route schedules
This commit is contained in:
@@ -8,19 +8,22 @@ import type {
|
||||
export const getSchedules = async (
|
||||
params?: Record<string, unknown>
|
||||
): Promise<GetSchedulesResponseType> => {
|
||||
const { data } = await axios.get<GetSchedulesResponseType>("/schedules", {
|
||||
params,
|
||||
});
|
||||
const { data } = await axios.get<GetSchedulesResponseType>(
|
||||
"/admin/schedules",
|
||||
{
|
||||
params,
|
||||
}
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const deleteSchedule = async (id: string) => {
|
||||
const { data } = await axios.delete(`/schedules/${id}`);
|
||||
const { data } = await axios.delete(`/admin/schedules/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const createSchedule = async (params: CreateScheduleType) => {
|
||||
const { data } = await axios.post("/schedules", params);
|
||||
const { data } = await axios.post("/admin/schedules", params);
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -28,13 +31,15 @@ export const updateSchedule = async (
|
||||
id: string,
|
||||
params: CreateScheduleType
|
||||
) => {
|
||||
const { data } = await axios.patch(`/schedules/${id}`, params);
|
||||
const { data } = await axios.patch(`/admin/schedules/${id}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getSchedule = async (
|
||||
id: string
|
||||
): Promise<GetScheduleResponseType> => {
|
||||
const { data } = await axios.get<GetScheduleResponseType>(`/schedules/${id}`);
|
||||
const { data } = await axios.get<GetScheduleResponseType>(
|
||||
`/admin/schedules/${id}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user