| 1234567891011121314151617181920 |
- import { cache } from 'react';
- import { ResultDto } from '@/types/response/common';
- import { fetchJson } from '@/lib/utils/server';
- import Config, { NavMenuLink } from '@/types/config';
- // Config 값 조회
- export const fetchConfig = cache(async (): Promise<ResultDto<Config|null>> => {
- return await fetchJson<Config>('/api/config', {
- method: 'GET',
- headers: {'Content-Type': 'application/json'},
- });
- });
- // 관리자 관리형 상단 메뉴 조회 (노출 항목만 정렬순)
- export const fetchNavMenu = cache(async (): Promise<ResultDto<{ items: NavMenuLink[] }|null>> => {
- return await fetchJson<{ items: NavMenuLink[] }>('/api/config/nav-menu', {
- method: 'GET',
- headers: {'Content-Type': 'application/json'},
- });
- });
|