Fix table issue in last row

This commit is contained in:
shunmugam 2019-09-11 17:41:46 +05:30
parent 539fae5496
commit ee1b98d5b8

View File

@ -1012,6 +1012,7 @@ export class BlockchainBlockController {
// MaxPages, // MaxPages,
PageSize, PageSize,
}: BlockchainBlockPaginationDto = request.query; }: BlockchainBlockPaginationDto = request.query;
console.log("Page size",PageSize);
if (parseInt(CurrentPage) == NaN) { if (parseInt(CurrentPage) == NaN) {
next(new IntegerValidationException('CurrentPage')); next(new IntegerValidationException('CurrentPage'));
} else if (parseInt(PageSize) == NaN) { } else if (parseInt(PageSize) == NaN) {
@ -1076,14 +1077,15 @@ export class BlockchainBlockController {
.leftJoin('blockchain_block.BlockchainKernels', 'blockchain_kernel') .leftJoin('blockchain_block.BlockchainKernels', 'blockchain_kernel')
.leftJoin('blockchain_block.BlockchainOutputs', 'blockchain_output') .leftJoin('blockchain_block.BlockchainOutputs', 'blockchain_output')
.skip(PaginationReponseData.startIndex) .skip(PaginationReponseData.startIndex)
.take(PaginationReponseData.pageSize) .take(PaginationReponseData.pageSize+1)
.orderBy('blockchain_block.Timestamp', 'DESC') .orderBy('blockchain_block.Timestamp', 'DESC')
.groupBy('blockchain_block.Hash') .groupBy('blockchain_block.Hash')
.getRawAndEntities(); .getRawAndEntities();
//console.log(BlockchainBlockPaginationQuery.raw); console.log("page.size", PaginationReponseData.pageSize + 1);
let BlockchainBlockResult = BlockchainBlockPaginationQuery.raw; let BlockchainBlockResult = BlockchainBlockPaginationQuery.raw;
BlockchainBlockResult.splice(-1,1);
let lastElemt = let lastElemt =
BlockchainBlockResult[BlockchainBlockResult.length - 1]; BlockchainBlockResult[BlockchainBlockResult.length - 1];
const BlockchainPreviousBlockFetchQuery = await getConnection(Global.network).getRepository( const BlockchainPreviousBlockFetchQuery = await getConnection(Global.network).getRepository(