domesticSummary.ts 578 B

12345678910111213141516
  1. 'use server';
  2. import { ResultDto } from '@/types/response/common';
  3. import { DomesticSummaryResponse } from '@/types/domesticSummary';
  4. import { fetchJson } from '@/lib/utils/server';
  5. const JSON_HEADERS = { 'Accept': 'application/json' } as const;
  6. // 국내 증시 요약 — 코스피/코스닥/KOSPI200 지수 + 등락종목수 (메인, 익명 열람)
  7. export async function fetchDomesticSummary(): Promise<ResultDto<DomesticSummaryResponse>>
  8. {
  9. return await fetchJson<DomesticSummaryResponse>('/api/market/domestic-summary', {
  10. method: 'GET',
  11. headers: JSON_HEADERS
  12. });
  13. }