690328:2128 Fixing Refactor uuid by Kimi #12
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user