mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: creating index from attributes
This commit is contained in:
+9
-1
@@ -2,6 +2,7 @@
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button, InputText, FormList, InputSelect } from '$lib/elements/forms';
|
||||
import { collection } from '../store';
|
||||
import { onMount } from 'svelte';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { page } from '$app/stores';
|
||||
@@ -10,6 +11,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
|
||||
export let showCreateIndex = false;
|
||||
export let externalAttribute: Attributes = null;
|
||||
|
||||
const databaseId = $page.params.database;
|
||||
|
||||
@@ -30,6 +32,12 @@
|
||||
let selectedAttribute = '';
|
||||
let selectedOrder = '';
|
||||
|
||||
onMount(() => {
|
||||
if (externalAttribute) {
|
||||
attributeList = [{ value: externalAttribute.key, order: 'ASC' }];
|
||||
}
|
||||
});
|
||||
|
||||
$: if (showCreateIndex) {
|
||||
attributeList = [];
|
||||
selectedType = selectedOrder = selectedAttribute = '';
|
||||
@@ -122,7 +130,7 @@
|
||||
<div class="form-item-part u-cross-child-end">
|
||||
<Button
|
||||
text
|
||||
disabled={i === 0}
|
||||
disabled={externalAttribute && i === 0}
|
||||
on:click={() => {
|
||||
if (i === 0) attributeList = [];
|
||||
attributeList = attributeList.splice(i, 1);
|
||||
|
||||
Reference in New Issue
Block a user