크레딧 충전 기능 및 UI 수정

This commit is contained in:
skkim committed 2026-05-04 13:47:38 +09:00
1 parent 82dcda0038
commit 00ea49b7ed
8 files changed
+419 -13

No files matched your search

+13
View File
@@ -665,6 +665,19 @@ export async function getUserCredits(): Promise<UserCreditsResponse> {
return response.json();
}
// 크레딧 충전 요청
export async function requestCreditCharge(amount: number, note: string): Promise<void> {
const response = await authenticatedFetch(`${API_URL}/user/credits/charge-requests`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ requested_amount: amount, message: note }),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
}
// 로그인 여부 확인
export function isLoggedIn(): boolean {
return !!getAccessToken();