import { ResultDto } from '@/types/response/common';
import { DocumentResponse } from '@/types/response/page/document';
import { fetchJson } from '@/lib/utils/server';

export async function fetchDocument(code: string): Promise<ResultDto<DocumentResponse|null>> {
	return await fetchJson<DocumentResponse>(`/api/document/${code}`, {
		method: 'GET',
		headers: { 'Content-Type': 'application/json' },
	});
}
