mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-31 19:56:35 +00:00
fix: default sorting on tables (#299)
Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
@@ -17,10 +17,17 @@
|
||||
import OneTimeLinkModal from './one-time-link-modal.svelte';
|
||||
|
||||
let { users = $bindable() }: { users: Paginated<User> } = $props();
|
||||
let requestOptions: SearchPaginationSortRequest | undefined = $state();
|
||||
|
||||
let userIdToCreateOneTimeLink: string | null = $state(null);
|
||||
|
||||
let requestOptions: SearchPaginationSortRequest | undefined = $state({
|
||||
sort: { column: 'firstName', direction: 'asc' },
|
||||
pagination: {
|
||||
page: users.pagination.currentPage,
|
||||
limit: users.pagination.itemsPerPage
|
||||
}
|
||||
});
|
||||
|
||||
const userService = new UserService();
|
||||
|
||||
async function deleteUser(user: User) {
|
||||
@@ -47,6 +54,7 @@
|
||||
<AdvancedTable
|
||||
items={users}
|
||||
{requestOptions}
|
||||
defaultSort={{ column: 'firstName', direction: 'asc' }}
|
||||
onRefresh={async (options) => (users = await userService.list(options))}
|
||||
columns={[
|
||||
{ label: 'First name', sortColumn: 'firstName' },
|
||||
|
||||
Reference in New Issue
Block a user