Fix display empty value if boolean instead of false on show page (#4468)
* default value boolean fixed * fixed creation, fixed updating a value to false * fixed default value for default value if boolean * fixed tests --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -300,10 +300,12 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
||||
await fieldMetadataRepository.update(id, {
|
||||
...updatableFieldInput,
|
||||
defaultValue:
|
||||
// Todo: we need to handle default value for all field types. Right now we are only allowing update for SELECt
|
||||
existingFieldMetadata.type !== FieldMetadataType.SELECT
|
||||
// Todo: we handle default value for all field types.
|
||||
![FieldMetadataType.SELECT, FieldMetadataType.BOOLEAN].includes(
|
||||
existingFieldMetadata.type,
|
||||
)
|
||||
? existingFieldMetadata.defaultValue
|
||||
: updatableFieldInput.defaultValue
|
||||
: updatableFieldInput.defaultValue !== null
|
||||
? updatableFieldInput.defaultValue
|
||||
: null,
|
||||
// If the name is updated, the targetColumnMap should be updated as well
|
||||
|
||||
Reference in New Issue
Block a user