change route schedules

This commit is contained in:
hamid zarghami
2025-11-19 09:08:04 +03:30
parent e9e66f129e
commit dc67fac104
+11 -6
View File
@@ -8,19 +8,22 @@ import type {
export const getSchedules = async ( export const getSchedules = async (
params?: Record<string, unknown> params?: Record<string, unknown>
): Promise<GetSchedulesResponseType> => { ): Promise<GetSchedulesResponseType> => {
const { data } = await axios.get<GetSchedulesResponseType>("/schedules", { const { data } = await axios.get<GetSchedulesResponseType>(
"/admin/schedules",
{
params, params,
}); }
);
return data; return data;
}; };
export const deleteSchedule = async (id: string) => { export const deleteSchedule = async (id: string) => {
const { data } = await axios.delete(`/schedules/${id}`); const { data } = await axios.delete(`/admin/schedules/${id}`);
return data; return data;
}; };
export const createSchedule = async (params: CreateScheduleType) => { export const createSchedule = async (params: CreateScheduleType) => {
const { data } = await axios.post("/schedules", params); const { data } = await axios.post("/admin/schedules", params);
return data; return data;
}; };
@@ -28,13 +31,15 @@ export const updateSchedule = async (
id: string, id: string,
params: CreateScheduleType params: CreateScheduleType
) => { ) => {
const { data } = await axios.patch(`/schedules/${id}`, params); const { data } = await axios.patch(`/admin/schedules/${id}`, params);
return data; return data;
}; };
export const getSchedule = async ( export const getSchedule = async (
id: string id: string
): Promise<GetScheduleResponseType> => { ): Promise<GetScheduleResponseType> => {
const { data } = await axios.get<GetScheduleResponseType>(`/schedules/${id}`); const { data } = await axios.get<GetScheduleResponseType>(
`/admin/schedules/${id}`
);
return data; return data;
}; };