chore: remove unused search from buckets

This commit is contained in:
Arman committed 2022-10-07 11:24:38 +02:00
1 parent 91649ed743
commit a866c04bb1
2 files changed
+4 -22

No files matched your search

@@ -13,7 +13,6 @@
import { cardLimit } from '$lib/stores/layout';
let showCreate = false;
let search = '';
let offset = 0;
const project = $page.params.project;
@@ -22,8 +21,7 @@
await goto(`${base}/console/project-${project}/storage/bucket/${event.detail.$id}`);
};
$: bucketList.load([Query.limit($cardLimit), Query.offset(offset)], search);
$: if (search) offset = 0;
$: bucketList.load([Query.limit($cardLimit), Query.offset(offset)]);
</script>
<Container>
@@ -86,22 +84,6 @@
<p class="text">Total results: {$bucketList.total}</p>
<Pagination limit={$cardLimit} bind:offset sum={$bucketList.total} />
</div>
{:else if search}
<Empty>
<div class="u-flex u-flex-vertical">
<b>Sorry, we couldn’t find ‘{search}’</b>
<div class="common-section">
<p>There are no buckets that match your search.</p>
</div>
<div class="common-section">
<Button secondary on:click={() => (search = '')}>Clear Search</Button>
</div>
</div>
</Empty>
<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: {$bucketList?.total}</p>
<Pagination limit={$cardLimit} bind:offset sum={$bucketList?.total} />
</div>
{:else}
<Empty isButton single on:click={() => (showCreate = true)}>
<p>Add your first bucket to get started</p>
@@ -5,12 +5,12 @@ import { cachedStore } from '$lib/helpers/cache';
export const bucketList = cachedStore<
Models.BucketList,
{
load: (queries: string[], search: string) => Promise<void>;
load: (queries: string[]) => Promise<void>;
}
>('bucketList', function ({ set }) {
return {
load: async (queries, search) => {
const response = await sdkForProject.storage.listBuckets(queries, search);
load: async (queries) => {
const response = await sdkForProject.storage.listBuckets(queries);
set(response);
}
};