diff --git a/src/lib/components/pagination/index.svelte b/src/lib/components/pagination/index.svelte
index ebc22b5..60df686 100644
--- a/src/lib/components/pagination/index.svelte
+++ b/src/lib/components/pagination/index.svelte
@@ -48,9 +48,9 @@
Per-page:
{
- dispatch('update', { pageSize: e.detail, page });
+ dispatch('perPageEvent', { pageSize: e.detail, page });
}}
let:open
>
diff --git a/src/lib/components/search/textSearch/index.svelte b/src/lib/components/search/textSearch/index.svelte
index b680175..1ce44f7 100644
--- a/src/lib/components/search/textSearch/index.svelte
+++ b/src/lib/components/search/textSearch/index.svelte
@@ -1,13 +1,36 @@
-
-
- {#if advancedSearch}
-
- (disclosureOpen = !disclosureOpen)}
- >
- Advanced Search?
- {
+ gameStore.removeAll();
+ // data.append('limit', pageSize.toString());
+ // data.append('skip', Math.floor(page * pageSize).toString());
+ boredState.update((n) => ({ ...n, loading: true }));
+ return async ({ result }) => {
+ boredState.update((n) => ({ ...n, loading: false }));
+ console.log(result);
+ // `result` is an `ActionResult` object
+ if (result.type === 'error') {
+ toast.send('Error!', { duration: 3000, type: ToastType.ERROR, dismissible: true });
+ await applyAction(result);
+ } else if (result.type === 'success') {
+ gameStore.removeAll();
+ gameStore.addAll(result?.data?.games);
+ // totalItems = result?.data?.totalCount;
+ console.log(`Frontend result search enhance: ${JSON.stringify(result)}`);
+ totalItems = result?.data?.totalCount;
+ // skip = result?.data?.skip || 0;
+ // page = skip / pageSize || 0;
+ // console.log('enhance', page, skip, totalItems);
+ toast.send('Sucess!', { duration: 3000, type: ToastType.INFO, dismissible: true });
+ await applyAction(result);
+ } else {
+ await applyAction(result);
+ }
+ };
+ }}
+>
+
+
+
+
+ {#if advancedSearch}
+
+ (disclosureOpen = !disclosureOpen)}
+ >
+ Advanced Search?
+
+
- {#if disclosureOpen}
-
- {/if}
-
- {/if}
-
-{#if showButton}
-
-{/if}
+
+
+
+
+ {/if}
+
+ {/if}
+
+
+
+
+
+
+ console.log('Prev page called', event)}
+ on:perPageEvent={handlePerPageEvent}
+/>