Fix default value being set to null when not provider to fieldMetadataUpdate
This commit is contained in:
@ -235,7 +235,11 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
|
|
||||||
const updatedFieldMetadata = await super.updateOne(id, {
|
const updatedFieldMetadata = await super.updateOne(id, {
|
||||||
...updatableFieldInput,
|
...updatableFieldInput,
|
||||||
defaultValue: updatableFieldInput.defaultValue
|
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
|
||||||
|
? existingFieldMetadata.defaultValue
|
||||||
|
: updatableFieldInput.defaultValue
|
||||||
? // Todo: we need to rework DefaultValue typing and format to be simpler, there is no need to have this complexity
|
? // Todo: we need to rework DefaultValue typing and format to be simpler, there is no need to have this complexity
|
||||||
{ value: updatableFieldInput.defaultValue as unknown as string }
|
{ value: updatableFieldInput.defaultValue as unknown as string }
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user