Skip to content

Commit 4c0c63a

Browse files
authored
Merge pull request #175 from workfloworchestrator/fix-translate-label-function
Handle objects in translateLabel
2 parents b84354c + 2d1366c commit 4c0c63a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/packages/pydantic-forms/src/core/hooks/usePydanticFormParser.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ const translateLabel = (
3333
label?: string,
3434
formLabels?: Record<string, string>,
3535
): string | undefined => {
36-
return formLabels && formLabels[propertyId]
36+
const isString = typeof formLabels?.[propertyId] === 'string';
37+
return formLabels && formLabels[propertyId] && isString
3738
? formLabels[propertyId].toString()
3839
: label;
3940
};

0 commit comments

Comments
 (0)