mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-30 03:06:37 +00:00
refactor: adapt api key list to new sort behavior
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { ACCESS_TOKEN_COOKIE_NAME } from '$lib/constants';
|
||||
import ApiKeyService from '$lib/services/api-key-service';
|
||||
import type { SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({ cookies }) => {
|
||||
const apiKeyService = new ApiKeyService(cookies.get(ACCESS_TOKEN_COOKIE_NAME));
|
||||
|
||||
const apiKeys = await apiKeyService.list({
|
||||
const apiKeysRequestOptions: SearchPaginationSortRequest = {
|
||||
sort: {
|
||||
column: 'lastUsedAt',
|
||||
direction: 'desc' as const
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return apiKeys;
|
||||
const apiKeys = await apiKeyService.list(apiKeysRequestOptions);
|
||||
|
||||
return { apiKeys, apiKeysRequestOptions };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user