NORY-47: configure default values for JSON inputs

This commit is contained in:
Markus Thielker 2024-12-30 19:18:45 +01:00
parent a7c13d27f5
commit 9a2e349340
No known key found for this signature in database

View file

@ -34,8 +34,10 @@ export function IdentityTraitForm({ schema, identity }: IdentityTraitFormProps)
resolver: zodResolver(zodIdentitySchema),
defaultValues: {
...currentIdentity.traits,
metadata_public: currentIdentity.metadata_public ? JSON.stringify(currentIdentity.metadata_public) : '',
metadata_admin: currentIdentity.metadata_admin ? JSON.stringify(currentIdentity.metadata_admin) : '',
metadata_public: currentIdentity.metadata_public ?
JSON.stringify(currentIdentity.metadata_public) : '{}',
metadata_admin: currentIdentity.metadata_admin ?
JSON.stringify(currentIdentity.metadata_admin) : '{}',
},
});