Skip to content

Commit 8381af6

Browse files
authored
Merge pull request #2130 from appwrite/fix-nullable-inputs
2 parents 4fbbcdc + 1070d29 commit 8381af6

File tree

5 files changed

+16
-24
lines changed

5 files changed

+16
-24
lines changed

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/boolean.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<InputSelect
1313
{id}
1414
{label}
15+
bind:value
1516
{optionalText}
1617
placeholder="Select a value"
1718
required={attribute.required}
1819
options={[
1920
!attribute.required && { label: 'NULL', value: null },
2021
{ label: 'True', value: true },
2122
{ label: 'False', value: false }
22-
].filter(Boolean)}
23-
bind:value />
23+
].filter(Boolean)} />

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/email.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
export let label: string;
77
export let value: string | null;
88
export let attribute: Models.AttributeUrl;
9-
10-
$: nullable = attribute.required ? false : !value;
119
</script>
1210

1311
<InputEmail
1412
{id}
1513
{label}
16-
{nullable}
14+
bind:value
1715
placeholder="Enter URL"
1816
required={attribute.required}
19-
bind:value />
17+
nullable={!attribute.required} />

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/integer.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
export let label: string;
77
export let value: number;
88
export let attribute: Models.AttributeInteger;
9-
10-
$: nullable = attribute.required ? false : !value;
119
</script>
1210

1311
<InputNumber
1412
{id}
1513
{label}
16-
{nullable}
17-
required={attribute.required}
14+
bind:value
1815
min={attribute.min}
1916
max={attribute.max}
20-
step={attribute.type === 'double' ? 'any' : 1}
21-
bind:value />
17+
required={attribute.required}
18+
nullable={!attribute.required}
19+
step={attribute.type === 'double' ? 'any' : 1} />

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/string.svelte

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,24 @@
66
export let label: string;
77
export let value: string;
88
export let attribute: Models.AttributeString;
9-
10-
$: nullable = attribute.required ? false : !value;
119
</script>
1210

1311
{#if attribute.size >= 50}
1412
<InputTextarea
1513
{id}
1614
{label}
17-
{nullable}
15+
bind:value
1816
placeholder="Enter string"
19-
required={attribute.required}
2017
maxlength={attribute.size}
21-
bind:value />
18+
required={attribute.required}
19+
nullable={!attribute.required} />
2220
{:else}
2321
<InputText
2422
{id}
2523
{label}
26-
{nullable}
24+
bind:value
2725
placeholder="Enter string"
28-
required={attribute.required}
2926
maxlength={attribute.size}
30-
bind:value />
27+
required={attribute.required}
28+
nullable={!attribute.required} />
3129
{/if}

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributes/url.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
export let label: string;
77
export let value: string | null;
88
export let attribute: Models.AttributeUrl;
9-
10-
$: nullable = attribute.required ? false : !value;
119
</script>
1210

1311
<InputURL
1412
{id}
1513
{label}
16-
{nullable}
14+
bind:value
1715
placeholder="Enter URL"
1816
required={attribute.required}
19-
bind:value />
17+
nullable={!attribute.required} />

0 commit comments

Comments
 (0)