fix: fix Settings field form validation for certain field types (#5335)

Related to #4295

Following #5326, field types other than:
- `FieldMetadataType.Boolean`
- `FieldMetadataType.Currency`
- `FieldMetadataType.Relation`
- `FieldMetadataType.Select`
- `FieldMetadataType.MultiSelect`

Cannot be saved as they are not included in the form validation schema.
This PR makes sure they are included and can therefore be
created/edited.
This commit is contained in:
Thaïs
2024-05-08 12:13:34 +02:00
committed by GitHub
parent 8c85e7bf61
commit 005045c596
5 changed files with 26 additions and 6 deletions

View File

@ -211,7 +211,8 @@ export const SettingsObjectNewFieldStep2 = () => {
const createdMetadataField = await createMetadataField({
...formValues,
defaultValue:
formValues.type === FieldMetadataType.Currency
formValues.type === FieldMetadataType.Currency &&
'defaultValue' in formValues
? {
...formValues.defaultValue,
amountMicros: null,