document.ts 408 B

12345678910
  1. import { ResultDto } from '@/types/response/common';
  2. import { DocumentResponse } from '@/types/response/page/document';
  3. import { fetchJson } from '@/lib/utils/server';
  4. export async function fetchDocument(code: string): Promise<ResultDto<DocumentResponse|null>> {
  5. return await fetchJson<DocumentResponse>(`/api/document/${code}`, {
  6. method: 'GET',
  7. headers: { 'Content-Type': 'application/json' },
  8. });
  9. }