refactor: reset field default value on type change in Settings (#5534)

Related issue: #5412

See https://github.com/twentyhq/twenty/pull/5436#discussion_r1609470484
for context.
This commit is contained in:
Thaïs
2024-05-24 12:15:17 +02:00
committed by GitHub
parent 18fafbdeb5
commit 7f7ea59b51
23 changed files with 326 additions and 131 deletions

View File

@ -215,16 +215,6 @@ export const SettingsObjectNewFieldStep2 = () => {
} else {
const createdMetadataField = await createMetadataField({
...formValues,
defaultValue:
formValues.type === FieldMetadataType.Currency &&
'defaultValue' in formValues
? {
...formValues.defaultValue,
amountMicros: null,
}
: 'defaultValue' in formValues
? formValues.defaultValue
: undefined,
objectMetadataId: activeObjectMetadataItem.id,
});