29 lines
692 B
JavaScript
29 lines
692 B
JavaScript
|
|
/**
|
||
|
|
* 일정 관련 공개 API
|
||
|
|
*/
|
||
|
|
import { fetchApi } from "./index";
|
||
|
|
|
||
|
|
// 일정 목록 조회 (월별)
|
||
|
|
export async function getSchedules(year, month) {
|
||
|
|
return fetchApi(`/api/schedules?year=${year}&month=${month}`);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 일정 검색 (Meilisearch)
|
||
|
|
export async function searchSchedules(query, { offset = 0, limit = 20 } = {}) {
|
||
|
|
return fetchApi(
|
||
|
|
`/api/schedules?search=${encodeURIComponent(
|
||
|
|
query
|
||
|
|
)}&offset=${offset}&limit=${limit}`
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 일정 상세 조회
|
||
|
|
export async function getSchedule(id) {
|
||
|
|
return fetchApi(`/api/schedules/${id}`);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 카테고리 목록 조회
|
||
|
|
export async function getCategories() {
|
||
|
|
return fetchApi("/api/schedule-categories");
|
||
|
|
}
|