Build fix

This commit is contained in:
Matej Bačo
2026-03-25 18:17:48 +01:00
parent 3c8e4638cc
commit d48f4a62de
2 changed files with 14 additions and 11 deletions
@@ -6,7 +6,7 @@
import { Modal } from '$lib/components';
import { type Entity, SideSheet } from '$database/(entity)';
import { isSmallViewport } from '$lib/stores/viewport';
import { IndexType, OrderBy } from '@appwrite.io/console';
import { DatabasesIndexType, OrderBy } from '@appwrite.io/console';
import { capitalize } from '$lib/helpers/string';
import { type Columns } from '../table-[table]/store';
import { isRelationship } from '../table-[table]/rows/store';
@@ -68,7 +68,7 @@
indexes = mockSuggestions.columns.slice(0, 3).map((column, index) => ({
key: column.name,
type: IndexType.Key,
type: DatabasesIndexType.Key,
fields: [column.name],
orders: index === 2 ? OrderBy.Desc : OrderBy.Asc,
lengths: []
@@ -85,7 +85,7 @@
indexes = suggestions.indexes.map((index) => {
return {
key: index.columns[0],
type: index.type as IndexType,
type: index.type as DatabasesIndexType,
orders: (index.orders?.[0] as OrderBy) || OrderBy.Asc,
fields: index.columns,
lengths: index.lengths ?? []
@@ -113,7 +113,7 @@
if (indexes.length < MAX_INDEXES) {
indexes.push({
key: '',
type: IndexType.Key,
type: DatabasesIndexType.Key,
orders: OrderBy.Asc,
fields: [],
lengths: null
@@ -134,9 +134,9 @@
}
}
function getOrderOptions(selectedType: IndexType) {
function getOrderOptions(selectedType: DatabasesIndexType) {
const base = [OrderBy.Asc, OrderBy.Desc];
const values = selectedType === IndexType.Spatial ? [...base, null] : base;
const values = selectedType === DatabasesIndexType.Spatial ? [...base, null] : base;
return values.map((order) => ({
label: order ? capitalize(String(order)) : 'None',
@@ -166,7 +166,7 @@
// prepare lengths array
let lengths: (number | null)[];
if (index.type === IndexType.Key) {
if (index.type === DatabasesIndexType.Key) {
// only validate if it's a key index
lengths = index.fields.map((columnKey, i) => {
const maxSize = columnMap.get(columnKey);
@@ -293,9 +293,12 @@
}
const typeOptions = $derived(
Object.values(IndexType)
Object.values(DatabasesIndexType)
.filter((type) => {
if (type === IndexType.Spatial && !$regionalConsoleVariables?.supportForSpatials)
if (
type === DatabasesIndexType.Spatial &&
!$regionalConsoleVariables?.supportForSpatials
)
return false;
return true;
})
@@ -1,5 +1,5 @@
import { writable } from 'svelte/store';
import { IndexType, OrderBy } from '@appwrite.io/console';
import { DatabasesIndexType, OrderBy } from '@appwrite.io/console';
import { columnOptions } from '../table-[table]/columns/store';
export type TableColumnSuggestions = {
@@ -34,7 +34,7 @@ export type IndexOrder = OrderBy | null;
export type SuggestedIndexSchema = {
key: string;
type: IndexType;
type: DatabasesIndexType;
orders: IndexOrder;
fields: string[];
lengths?: number[] | undefined;