diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte index 609687700..9c56d3d44 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte @@ -9,6 +9,7 @@ import type { Attributes } from '../store'; import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; + import Select from './select.svelte'; export let showCreateIndex = false; export let externalAttribute: Attributes = null; @@ -22,7 +23,7 @@ { value: 'fulltext', label: 'FullText' } ]; let newAttr = false; - let selectedType = ''; + let selectedType = 'key'; $: attributeOptions = $collection.attributes.map((attribute: Attributes) => ({ value: attribute.key, label: attribute.key @@ -40,7 +41,8 @@ $: if (showCreateIndex) { attributeList = []; - selectedType = selectedOrder = selectedAttribute = ''; + selectedOrder = selectedAttribute = ''; + selectedType = 'key'; key = null; } const created = async () => { @@ -95,36 +97,28 @@ {#each attributeList as index, i}