* Fixed #3166 * refactor: improve generateEmptyFieldValue function - Optimize handling of MultiSelect and Select cases - Provide a default value for Select based on FieldSelectValue - Enhance code readability and maintainability * Fixed #3166 - Introduce MultiSelect-specific logic with a backend support check - Implement Select-specific logic with a default value - Throw an error for unhandled FieldMetadataType --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -41,9 +41,6 @@ export const generateEmptyFieldValue = (
|
||||
case FieldMetadataType.Relation: {
|
||||
return null;
|
||||
}
|
||||
case FieldMetadataType.Select: {
|
||||
return null;
|
||||
}
|
||||
case FieldMetadataType.Currency: {
|
||||
return {
|
||||
amountMicros: null,
|
||||
@ -51,9 +48,14 @@ export const generateEmptyFieldValue = (
|
||||
__typename: 'Currency',
|
||||
};
|
||||
}
|
||||
|
||||
case FieldMetadataType.Select: {
|
||||
return null;
|
||||
}
|
||||
case FieldMetadataType.MultiSelect: {
|
||||
throw new Error('Not implemented yet');
|
||||
}
|
||||
default: {
|
||||
throw new Error('Unhandled FieldMetadataType');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user