feat: 일정 등록 기능
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import type {
|
||||
Schedule,
|
||||
ScheduleFormData,
|
||||
ScheduleParams,
|
||||
ScheduleService,
|
||||
} from "../model/schedule-interface";
|
||||
|
||||
class ScheduleApiService implements ScheduleService {
|
||||
public async getSchedules(params?: ScheduleParams): Promise<Schedule[]> {
|
||||
const response = await client.get<Schedule[]>(
|
||||
ENDPOINT.CMS_SERVICE.SCHEDULES,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async createSchedule(data: ScheduleFormData): Promise<void> {
|
||||
await client.post(ENDPOINT.CMS_SERVICE.SCHEDULES, data);
|
||||
}
|
||||
}
|
||||
|
||||
export const ScheduleApi = new ScheduleApiService();
|
||||
Reference in New Issue
Block a user