mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: use correct name for attribute
This commit is contained in:
+6
-6
@@ -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)} />
|
||||
|
||||
+1
-1
@@ -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} />
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
+2
-3
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user