web/elements: persist table page in URL parameters

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-01-26 10:32:59 +01:00
parent 93772e492b
commit 5144a9af4c
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,7 @@ export abstract class Table<T> extends AKElement {
data?: PaginatedResponse<T>; data?: PaginatedResponse<T>;
@property({ type: Number }) @property({ type: Number })
page = 1; page = getURLParam("page", 1);
@property({ type: String }) @property({ type: String })
order?: string; order?: string;
@ -426,6 +426,7 @@ export abstract class Table<T> extends AKElement {
.pages=${this.data?.pagination} .pages=${this.data?.pagination}
.pageChangeHandler=${(page: number) => { .pageChangeHandler=${(page: number) => {
this.page = page; this.page = page;
updateURLParams({ page: page });
this.fetch(); this.fetch();
}} }}
> >