From ac802170f09f2a7f977da0942cbeeb605f70fa7b Mon Sep 17 00:00:00 2001 From: gpascal123 Date: Fri, 1 Aug 2025 09:51:37 +0200 Subject: [PATCH] The hashes are displayed again on the Hashes of Tasks page. --- .../core/_datasources/hashes.datasource.ts | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/src/app/core/_datasources/hashes.datasource.ts b/src/app/core/_datasources/hashes.datasource.ts index c9adbb3d..0cb65eaf 100644 --- a/src/app/core/_datasources/hashes.datasource.ts +++ b/src/app/core/_datasources/hashes.datasource.ts @@ -64,19 +64,13 @@ export class HashesDataSource extends BaseDataSource { included: responseHash.included }); - const length = response.meta.page.total_elements; - const nextLink = response.links.next; - const prevLink = response.links.prev; - const after = nextLink ? new URL(nextLink).searchParams.get("page[after]") : null; - const before = prevLink ? new URL(prevLink).searchParams.get("page[before]") : null; - - this.setPaginationConfig( - this.pageSize, - length, - after, - before, - this.index - ); + const length = responseHash.meta.page.total_elements; + const nextLink = responseHash.links.next; + const prevLink = responseHash.links.prev; + const after = nextLink ? new URL(nextLink).searchParams.get('page[after]') : null; + const before = prevLink ? new URL(prevLink).searchParams.get('page[before]') : null; + + this.setPaginationConfig(this.pageSize, length, after, before, this.index); this.setData(hashes); }) ); @@ -108,16 +102,10 @@ export class HashesDataSource extends BaseDataSource { const length = response.meta.page.total_elements; const nextLink = response.links.next; const prevLink = response.links.prev; - const after = nextLink ? new URL(nextLink).searchParams.get("page[after]") : null; - const before = prevLink ? new URL(prevLink).searchParams.get("page[before]") : null; - - this.setPaginationConfig( - this.pageSize, - length, - after, - before, - this.index - ); + const after = nextLink ? new URL(nextLink).searchParams.get('page[after]') : null; + const before = prevLink ? new URL(prevLink).searchParams.get('page[before]') : null; + + this.setPaginationConfig(this.pageSize, length, after, before, this.index); this.setData(hashes); }) );