import recordAxiosInstance from "@/shared/services/recordAxiosInstance";
import { withHeaders } from "./withHeaders";
import { externalParam } from "@/external-portal/services/portalOutgoingService";
import { LetterTemplateListResponseDTO } from "@/record-management/components/hooks/useTemplate";

export const getTemplate = async (
  unitId: string,
  params: externalParam,
): Promise<LetterTemplateListResponseDTO> => {
  const { data } = await recordAxiosInstance.get<LetterTemplateListResponseDTO>(
    `record-templates/list/${unitId}`,
    {
      headers: withHeaders(),
      params,
    },
  );
  return data;
};
