From 7e2c17a64291bbe26364a376a92d6d9fc279ca98 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 12 Sep 2023 11:20:05 +0200 Subject: [PATCH] fix(admin-ui): Fix creating nullable string fields Fixes #2343 --- .../core/src/common/utilities/custom-field-default-value.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/admin-ui/src/lib/core/src/common/utilities/custom-field-default-value.ts b/packages/admin-ui/src/lib/core/src/common/utilities/custom-field-default-value.ts index 8430bbe310..1711b5b658 100644 --- a/packages/admin-ui/src/lib/core/src/common/utilities/custom-field-default-value.ts +++ b/packages/admin-ui/src/lib/core/src/common/utilities/custom-field-default-value.ts @@ -20,9 +20,9 @@ export function getDefaultValue(type: CustomFieldType, isNullable?: boolean) { case 'string': case 'text': case 'localeText': - return ''; + return isNullable ? null : ''; case 'boolean': - return false; + return isNullable ? null : false; case 'float': case 'int': return isNullable ? null : 0;