대시보드 추가기능 + 계좌인증
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { KisRuntimeCredentials } from "@/features/settings/store/use-kis-runtime-store";
|
||||
import type {
|
||||
DashboardActivityResponse,
|
||||
DashboardBalanceResponse,
|
||||
DashboardIndicesResponse,
|
||||
} from "@/features/dashboard/types/dashboard.types";
|
||||
@@ -65,6 +66,34 @@ export async function fetchDashboardIndices(
|
||||
return payload as DashboardIndicesResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주문내역/매매일지(활동 데이터)를 조회합니다.
|
||||
* @param credentials KIS 인증 정보
|
||||
* @returns 활동 데이터 응답
|
||||
* @see app/api/kis/domestic/activity/route.ts 서버 라우트
|
||||
*/
|
||||
export async function fetchDashboardActivity(
|
||||
credentials: KisRuntimeCredentials,
|
||||
): Promise<DashboardActivityResponse> {
|
||||
const response = await fetch("/api/kis/domestic/activity", {
|
||||
method: "GET",
|
||||
headers: buildKisRequestHeaders(credentials),
|
||||
cache: "no-store",
|
||||
});
|
||||
|
||||
const payload = (await response.json()) as
|
||||
| DashboardActivityResponse
|
||||
| { error?: string };
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
"error" in payload ? payload.error : "활동 데이터 조회 중 오류가 발생했습니다.",
|
||||
);
|
||||
}
|
||||
|
||||
return payload as DashboardActivityResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 대시보드 API 공통 헤더를 구성합니다.
|
||||
* @param credentials KIS 인증 정보
|
||||
|
||||
Reference in New Issue
Block a user