feat(frontend): X 봇 API 클라이언트 함수 추가

- getXBot, lookupXProfile, createXBot, updateXBot, deleteXBot

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
caadiq 2026-02-08 09:08:52 +09:00
parent 86769f1edc
commit ec0e587434

View file

@ -66,6 +66,61 @@ export async function deleteYouTubeBot(id) {
return fetchAuthApi(`/admin/youtube-bots/${id}`, { method: 'DELETE' }); return fetchAuthApi(`/admin/youtube-bots/${id}`, { method: 'DELETE' });
} }
/**
* X 상세 조회
* @param {number} id - X DB ID
* @returns {Promise<object>}
*/
export async function getXBot(id) {
return fetchAuthApi(`/admin/x-bots/${id}`);
}
/**
* X username으로 프로필 정보 조회
* @param {string} username - X username (@ 없이)
* @returns {Promise<object>}
*/
export async function lookupXProfile(username) {
return fetchAuthApi('/admin/x-bots/lookup', {
method: 'POST',
body: JSON.stringify({ username }),
});
}
/**
* X 추가
* @param {object} data - 데이터
* @returns {Promise<object>}
*/
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<object>}
*/
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<object>}
*/
export async function deleteXBot(id) {
return fetchAuthApi(`/admin/x-bots/${id}`, { method: 'DELETE' });
}
/** /**
* 시작 * 시작
* @param {string} id - ID * @param {string} id - ID