diff --git a/src/api.js b/src/api.js index 64c873a..3f01a47 100644 --- a/src/api.js +++ b/src/api.js @@ -680,3 +680,18 @@ export const getBatchJob = (id) => apiGet(`/api/music/generate-b export const listBatchJobs = (status='all') => apiGet(`/api/music/generate-batch?status=${status}`); export const listGenres = () => apiGet('/api/music/genres'); +// === 주간 회고 (weekly_review) === +// apiGet은 비-2xx 응답에서 `HTTP ...` 메시지로 Error를 throw 하므로 +// 404 케이스는 메시지를 파싱하여 null로 변환한다. +export const getLatestReview = () => apiGet('/api/lotto/review/latest').catch(e => { + if (e?.status === 404 || /^HTTP 404\b/.test(e?.message || '')) return null; + throw e; +}); + +export const getReviewHistory = (limit = 4) => + apiGet(`/api/lotto/review/history?limit=${limit}`).then(d => d.reviews || []); + +// === 큐레이터 4계층 원클릭 구매 === +export const bulkPurchase = ({ draw_no, tier_mode, sets, amount }) => + apiPost('/api/lotto/purchase/bulk', { draw_no, tier_mode, sets, amount }); +