mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
misc: cleanup.
This commit is contained in:
-1
@@ -4,7 +4,6 @@
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
// TODO: @itznotabug extract const $page = get(page);
|
||||
export async function submitFloat(
|
||||
databaseId: string,
|
||||
collectionId: string,
|
||||
|
||||
+6
-15
@@ -2,7 +2,7 @@
|
||||
import { get } from 'svelte/store';
|
||||
import { page } from '$app/stores';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { ID, Query, type Models, RelationshipType, RelationMutate } from '@appwrite.io/console';
|
||||
import { ID, type Models, Query, RelationMutate, RelationshipType } from '@appwrite.io/console';
|
||||
|
||||
export async function submitRelationship(
|
||||
databaseId: string,
|
||||
@@ -16,7 +16,7 @@
|
||||
if (!isValueOfStringEnum(RelationMutate, data.onDelete)) {
|
||||
throw new Error(`Invalid on delete: ${data.onDelete}`);
|
||||
}
|
||||
// TODO: @itznotabug extract const $page = get(page);
|
||||
|
||||
const $page = get(page);
|
||||
await sdk
|
||||
.forProject($page.params.region, $page.params.project)
|
||||
@@ -41,7 +41,6 @@
|
||||
if (!isValueOfStringEnum(RelationMutate, data.onDelete)) {
|
||||
throw new Error(`Invalid on delete: ${data.onDelete}`);
|
||||
}
|
||||
// TODO: @itznotabug extract const $page = get(page);
|
||||
|
||||
const $page = get(page);
|
||||
await sdk
|
||||
@@ -93,18 +92,10 @@
|
||||
|
||||
// Lifecycle hooks
|
||||
async function getCollections(search: string = null) {
|
||||
if (search) {
|
||||
// TODO: @itznotabug inline `collections`.
|
||||
const collections = await sdk
|
||||
.forProject($page.params.region, $page.params.project)
|
||||
.databases.listCollections(databaseId, [Query.orderDesc('')], search);
|
||||
return collections;
|
||||
} else {
|
||||
const collections = await sdk
|
||||
.forProject($page.params.region, $page.params.project)
|
||||
.databases.listCollections(databaseId, [Query.limit(100)]);
|
||||
return collections;
|
||||
}
|
||||
const queries = search ? [Query.orderDesc('')] : [Query.limit(100)];
|
||||
return sdk
|
||||
.forProject($page.params.region, $page.params.project)
|
||||
.databases.listCollections(databaseId, queries, search);
|
||||
}
|
||||
|
||||
function updateKeyName() {
|
||||
|
||||
Reference in New Issue
Block a user