Skip to content

Commit

Permalink
4086
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>

Signed-off-by: simvalery <valeriy.simonov@envisionblockchain.com>
  • Loading branch information
simvalery committed Sep 11, 2024
1 parent 0c10c26 commit 7c1ac92
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion policy-service/src/policy-engine/blocks/documents-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export class InterfaceDocumentsSource {
async getData(user: PolicyUser, uuid: string, queryParams: any): Promise<any> {
const ref = PolicyComponentsUtils.GetBlockRef<IPolicySourceBlock>(this);

let ret = {};

if (!queryParams) {
queryParams = {};
}
Expand Down Expand Up @@ -209,6 +211,17 @@ export class InterfaceDocumentsSource {
this.state[user.id] = sortState;
}
let data: any = await this._getData(user, ref, enableCommonSorting, sortState, paginationData, history);

if (paginationData) {
ret = Object.assign(ret, {
page: paginationData.page,
pageSize: paginationData.itemsPerPage,
totalCount: paginationData.size,
hasPreviousPage: paginationData.page > 0,
hasNextPage: ((paginationData.page + 1) * paginationData.itemsPerPage) < paginationData.size
});
}

if (
!enableCommonSorting && history
) {
Expand Down Expand Up @@ -264,7 +277,7 @@ export class InterfaceDocumentsSource {
}
}

return Object.assign(
ret = Object.assign(ret,
{
data,
blocks: filters,
Expand All @@ -275,6 +288,8 @@ export class InterfaceDocumentsSource {
}),
sortState
);

return ret;
}

/**
Expand Down

0 comments on commit 7c1ac92

Please sign in to comment.