system.ts 412 B

123456789101112
  1. import { cache } from 'react';
  2. import { ResultDto } from '@/types/response/common';
  3. import { fetchJson } from '@/lib/utils/server';
  4. import Config from '@/types/config';
  5. // Config 값 조회
  6. export const fetchConfig = cache(async (): Promise<ResultDto<Config|null>> => {
  7. return await fetchJson<Config>('/api/config', {
  8. method: 'GET',
  9. headers: {'Content-Type': 'application/json'},
  10. });
  11. });