690329:2252 Fixing refactor Correspondence GPT-5.3-Codex #05
CI / CD Pipeline / build (push) Successful in 22m17s
CI / CD Pipeline / deploy (push) Successful in 7m49s

This commit is contained in:
2026-03-29 22:52:42 +07:00
parent abbdebf2b9
commit 1c6fec6c65
13 changed files with 485 additions and 4 deletions
+12 -2
View File
@@ -25,6 +25,15 @@ interface CorrespondenceDetailProps {
selectedRevisionId?: string;
}
const normalizeUuid = (value?: string): string | undefined => {
if (typeof value !== 'string') {
return undefined;
}
const normalized = value.trim().toLowerCase();
return normalized.length > 0 ? normalized : undefined;
};
export function CorrespondenceDetail({ data, selectedRevisionId }: CorrespondenceDetailProps) {
const submitMutation = useSubmitCorrespondence();
const processMutation = useProcessWorkflow();
@@ -36,8 +45,9 @@ export function CorrespondenceDetail({ data, selectedRevisionId }: Correspondenc
if (!data) return <div>No data found</div>;
const selectedRevision = selectedRevisionId
? data.revisions?.find((r) => r.publicId === selectedRevisionId)
const normalizedSelectedRevisionId = normalizeUuid(selectedRevisionId);
const selectedRevision = normalizedSelectedRevisionId
? data.revisions?.find((r) => normalizeUuid(r.publicId) === normalizedSelectedRevisionId)
: undefined;
const currentRevision = selectedRevision || data.revisions?.find((r) => r.isCurrent) || data.revisions?.[0];
const subject = currentRevision?.subject || '-';