690327:1118 Fixing Refactor ADR-019 Naming convention uuid #14
This commit is contained in:
@@ -6,6 +6,7 @@ import { useRouter } from 'next/navigation';
|
||||
import { useCorrespondenceTypes, useContracts, useDisciplines } from '@/hooks/use-master-data';
|
||||
import { useProjects } from '@/hooks/use-projects';
|
||||
import { toast } from 'sonner';
|
||||
import { Contract, getContractPublicId } from '@/types/contract';
|
||||
|
||||
export default function NewTemplatePage() {
|
||||
const router = useRouter();
|
||||
@@ -15,9 +16,9 @@ export default function NewTemplatePage() {
|
||||
const { data: projects = [] } = useProjects();
|
||||
const projectId = 1; // Default or sync with selection
|
||||
const { data: contractsData } = useContracts(projectId);
|
||||
const contracts = Array.isArray(contractsData) ? contractsData : [];
|
||||
const firstContract = contracts[0] as { id?: number; publicId?: string } | undefined;
|
||||
const contractId = firstContract?.publicId ?? firstContract?.id;
|
||||
const contracts = (Array.isArray(contractsData) ? contractsData : []) as Contract[];
|
||||
const firstContract = contracts[0];
|
||||
const contractId = getContractPublicId(firstContract);
|
||||
const { data: disciplines = [] } = useDisciplines(contractId);
|
||||
|
||||
const selectedProjectName =
|
||||
|
||||
Reference in New Issue
Block a user