From ec0e587434eca7a3e40db48d1f822193f418b850 Mon Sep 17 00:00:00 2001 From: caadiq Date: Sun, 8 Feb 2026 09:08:52 +0900 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20X=20=EB=B4=87=20API=20?= =?UTF-8?q?=ED=81=B4=EB=9D=BC=EC=9D=B4=EC=96=B8=ED=8A=B8=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getXBot, lookupXProfile, createXBot, updateXBot, deleteXBot Co-Authored-By: Claude Opus 4.5 --- frontend/src/api/admin/bots.js | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/frontend/src/api/admin/bots.js b/frontend/src/api/admin/bots.js index a84da6a..61616ae 100644 --- a/frontend/src/api/admin/bots.js +++ b/frontend/src/api/admin/bots.js @@ -66,6 +66,61 @@ export async function deleteYouTubeBot(id) { return fetchAuthApi(`/admin/youtube-bots/${id}`, { method: 'DELETE' }); } +/** + * X 봇 상세 조회 + * @param {number} id - X 봇 DB ID + * @returns {Promise} + */ +export async function getXBot(id) { + return fetchAuthApi(`/admin/x-bots/${id}`); +} + +/** + * X username으로 프로필 정보 조회 + * @param {string} username - X username (@ 없이) + * @returns {Promise} + */ +export async function lookupXProfile(username) { + return fetchAuthApi('/admin/x-bots/lookup', { + method: 'POST', + body: JSON.stringify({ username }), + }); +} + +/** + * X 봇 추가 + * @param {object} data - 봇 데이터 + * @returns {Promise} + */ +export async function createXBot(data) { + return fetchAuthApi('/admin/x-bots', { + method: 'POST', + body: JSON.stringify(data), + }); +} + +/** + * X 봇 수정 + * @param {number} id - X 봇 DB ID + * @param {object} data - 업데이트할 데이터 + * @returns {Promise} + */ +export async function updateXBot(id, data) { + return fetchAuthApi(`/admin/x-bots/${id}`, { + method: 'PUT', + body: JSON.stringify(data), + }); +} + +/** + * X 봇 삭제 + * @param {number} id - X 봇 DB ID + * @returns {Promise} + */ +export async function deleteXBot(id) { + return fetchAuthApi(`/admin/x-bots/${id}`, { method: 'DELETE' }); +} + /** * 봇 시작 * @param {string} id - 봇 ID