tidy up
This commit is contained in:
parent
fb4b371d27
commit
c132b7b584
|
@ -7,10 +7,7 @@ import { enrichRows } from "./rows"
|
||||||
|
|
||||||
export const searchTable = async ({ tableId, search, pagination }) => {
|
export const searchTable = async ({ tableId, search, pagination }) => {
|
||||||
const rows = await searchTableData({ tableId, search, pagination })
|
const rows = await searchTableData({ tableId, search, pagination })
|
||||||
return rows
|
return await enrichRows(rows, tableId)
|
||||||
// TODO
|
|
||||||
// Enrich rows so they can displayed properly
|
|
||||||
// return await enrichRows(rows, tableId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
let page = 0
|
let page = 0
|
||||||
|
|
||||||
$: fetchData(table, page)
|
$: fetchData(table, page)
|
||||||
$: searchable = [...(table.indexes || []), ...columns]
|
|
||||||
// omit empty strings
|
// omit empty strings
|
||||||
$: parsedSearch = Object.keys(search).reduce(
|
$: parsedSearch = Object.keys(search).reduce(
|
||||||
(acc, next) =>
|
(acc, next) =>
|
||||||
|
@ -114,14 +113,12 @@
|
||||||
<p>{noRowsMessage}</p>
|
<p>{noRowsMessage}</p>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<!-- <Button primary on:click={previousPage}>First</Button> -->
|
|
||||||
{#if page > 0}
|
{#if page > 0}
|
||||||
<Button primary on:click={previousPage}>Back</Button>
|
<Button primary on:click={previousPage}>Back</Button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if rows.length === pageSize}
|
{#if rows.length === pageSize}
|
||||||
<Button primary on:click={nextPage}>Next</Button>
|
<Button primary on:click={nextPage}>Next</Button>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- <Button primary on:click={previousPage}>Last</Button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue