690328:2128 Fixing Refactor uuid by Kimi #12
CI / CD Pipeline / build (push) Successful in 6m14s
CI / CD Pipeline / deploy (push) Successful in 7m51s

This commit is contained in:
2026-03-28 21:28:53 +07:00
parent 7a9a15560b
commit 2993131496
5 changed files with 17 additions and 17 deletions
@@ -81,12 +81,12 @@ export default function DisciplinesPage() {
queryKey={['disciplines', selectedContractId ?? 'all']}
fetchFn={async () => {
const items = await masterDataService.getDisciplines(selectedContractId ? selectedContractId : undefined);
// ADR-019: Map contractId INT → contract UUID for edit mode select matching
// ADR-019: Map contract.publicId UUID for edit mode select matching
return items.map((item) => {
const rec = item as Discipline & { contract?: { id?: number; uuid?: string }; contractId?: number | string };
const rec = item as Discipline & { contract?: { publicId?: string }; contractId?: number | string };
return {
...item,
contractId: rec.contract?.id || rec.contract?.uuid || String(rec.contractId),
contractId: rec.contract?.publicId || (rec.contractId ? String(rec.contractId) : null),
} as Discipline;
});
}}
@@ -84,12 +84,12 @@ export default function RfaTypesPage() {
queryKey={['rfa-types', selectedContractId ?? 'all']}
fetchFn={async () => {
const items = await masterDataService.getRfaTypes(selectedContractId ? selectedContractId : undefined);
// ADR-019: Map contractId INT → contract UUID for edit mode select matching
// ADR-019: Map contract.publicId UUID for edit mode select matching
return items.map((item) => {
const rec = item as RfaType & { contract?: { id?: number | string; uuid?: string }; contract_id?: number | string };
const rec = item as RfaType & { contract?: { publicId?: string }; contractId?: number | string };
return {
...item,
contractId: rec.contract?.id || rec.contract?.uuid || (rec.contract_id ? String(rec.contract_id) : null),
contractId: rec.contract?.publicId || (rec.contractId ? String(rec.contractId) : null),
} as RfaType;
});
}}