diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/+page.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/+page.svelte index 22fb35e11b..5a26be8075 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/+page.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/+page.svelte @@ -1,30 +1,38 @@ - - {#if $canWriteCollections} - - {/if} - + + +
+
+ +
+ {#if $canWriteCollections} + + {/if} +
+
+
{#if data.collections.total} {#if data.view === 'grid'} @@ -38,6 +46,26 @@ limit={data.limit} offset={data.offset} total={data.collections.total} /> + {:else if data.search} + +
+ Sorry, we couldn't find '{data.search}' +

There are no collections that match your search.

+
+
+ + +
+
{:else} ($showCreate = true)} /> {/if}
+ + diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/+page.ts b/src/routes/(console)/project-[project]/databases/database-[database]/+page.ts index 03433c2a23..dc67ab4cbb 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/+page.ts +++ b/src/routes/(console)/project-[project]/databases/database-[database]/+page.ts @@ -1,12 +1,13 @@ import { Query } from '@appwrite.io/console'; import { sdk } from '$lib/stores/sdk'; -import { getLimit, getPage, getView, pageToOffset, View } from '$lib/helpers/load'; +import { getLimit, getPage, getView, pageToOffset, View, getSearch } from '$lib/helpers/load'; import type { PageLoad } from './$types'; import { CARD_LIMIT, Dependencies } from '$lib/constants'; export const load: PageLoad = async ({ params, url, route, depends }) => { depends(Dependencies.COLLECTIONS); const page = getPage(url); + const search = getSearch(url); const limit = getLimit(url, route, CARD_LIMIT); const view = getView(url, route, View.Grid); const offset = pageToOffset(page, limit); @@ -14,12 +15,13 @@ export const load: PageLoad = async ({ params, url, route, depends }) => { Query.limit(limit), Query.offset(offset), Query.orderDesc('') - ]); + ], search); return { offset, limit, view, + search, collections }; };