fix: use correct name for attribute

This commit is contained in:
Arman
2022-07-20 14:47:19 +02:00
parent 194f993961
commit bfcbc07ac0
10 changed files with 23 additions and 24 deletions
@@ -7,7 +7,7 @@
export let showCreate = false;
let id: string = null;
let key: string = null;
let selectedOption = '';
let submitted = false;
@@ -26,10 +26,10 @@
<svelte:fragment slot="header">Create Attribute</svelte:fragment>
<FormList>
<InputText
id="ID"
label="Attribute ID"
placeholder="Enter ID"
bind:value={id}
id="key"
label="Attribute Key"
placeholder="Enter Key"
bind:value={key}
autofocus
required />
@@ -50,7 +50,7 @@
{#if selectedOption}
<svelte:component
this={$option.component}
{id}
{key}
bind:submitted
on:created={created}
on:close={() => ($option = null)} />
@@ -46,7 +46,7 @@
{#if $collection?.attributes.length}
<Table>
<TableHeader>
<TableCellHead>ID</TableCellHead>
<TableCellHead>Key</TableCellHead>
<TableCellHead>Type</TableCellHead>
<TableCellHead>Default Value</TableCellHead>
<TableCellHead width={30} />
@@ -7,7 +7,7 @@
import type { Models } from '@aw-labs/appwrite-console';
export let submitted = false;
export let id: string;
export let key: string;
export let overview = false;
export let selectedAttribute: Models.AttributeBoolean;
@@ -22,7 +22,7 @@
try {
const attribute = await sdkForProject.databases.createBooleanAttribute(
$collection.$id,
id,
key,
required,
xdefault ? xdefault : undefined,
array
@@ -6,7 +6,7 @@
import { collection } from '../store';
import type { Models } from '@aw-labs/appwrite-console';
export let id: string;
export let key: string;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeEmail;
@@ -21,7 +21,7 @@
try {
const attribute = await sdkForProject.databases.createEmailAttribute(
$collection.$id,
id,
key,
required,
xdefault ? xdefault : undefined,
array
@@ -6,7 +6,7 @@
import { collection } from '../store';
import type { Models } from '@aw-labs/appwrite-console';
export let id: string;
export let key: string;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeEnum;
@@ -21,7 +21,7 @@
try {
const attribute = await sdkForProject.databases.createEnumAttribute(
$collection.$id,
id,
key,
elements,
required,
xdefault ? xdefault : undefined,
@@ -8,7 +8,7 @@
const dispatch = createEventDispatcher();
export let id: string;
export let key: string;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeFloat;
@@ -23,7 +23,7 @@
try {
const attribute = await sdkForProject.databases.createFloatAttribute(
$collection.$id,
id,
key,
required,
min,
max,
@@ -8,7 +8,7 @@
const dispatch = createEventDispatcher();
export let id: string = null;
export let key: string = null;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeInteger;
@@ -23,7 +23,7 @@
try {
const attribute = await sdkForProject.databases.createIntegerAttribute(
$collection.$id,
id,
key,
required,
min,
max,
@@ -44,7 +44,6 @@
}
$: if (overview) {
//TODO: fix xdefault
({ required, array, min, max } = selectedAttribute);
xdefault = selectedAttribute.default;
}
@@ -6,7 +6,7 @@
import { collection } from '../store';
import type { Models } from '@aw-labs/appwrite-console';
export let id: string;
export let key: string;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeIp;
@@ -20,7 +20,7 @@
try {
const attribute = await sdkForProject.databases.createIpAttribute(
$collection.$id,
id,
key,
required,
xdefault ? xdefault : undefined,
array
@@ -6,7 +6,7 @@
import { collection } from '../store';
import type { Models } from '@aw-labs/appwrite-console';
export let id: string;
export let key: string;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeString;
@@ -21,7 +21,7 @@
try {
const attribute = await sdkForProject.databases.createStringAttribute(
$collection.$id,
id,
key,
size,
required,
xdefault ? xdefault : undefined,
@@ -6,7 +6,7 @@
import { collection } from '../store';
import type { Models } from '@aw-labs/appwrite-console';
export let id: string;
export let key: string;
export let submitted = false;
export let overview = false;
export let selectedAttribute: Models.AttributeUrl;
@@ -20,7 +20,7 @@
try {
const attribute = await sdkForProject.databases.createUrlAttribute(
$collection.$id,
id,
key,
required,
xdefault ? xdefault : undefined,
array