From 7d8cf53c39da8ef9a4dcac53151f59dc0f025270 Mon Sep 17 00:00:00 2001 From: Yoshihiro OKUMURA Date: Thu, 9 May 2019 17:44:04 +0900 Subject: [PATCH] fixed bug for showing max number of items . --- src/components/DatabaseListItem.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/DatabaseListItem.tsx b/src/components/DatabaseListItem.tsx index 6eba862..54b3734 100644 --- a/src/components/DatabaseListItem.tsx +++ b/src/components/DatabaseListItem.tsx @@ -190,7 +190,10 @@ class DatabaseListItem extends Component { ); } const startNum = 1 + this.state.condition.limit * (this.state.condition.page - 1); - const endNum = this.state.condition.limit * this.state.condition.page; + let endNum = this.state.condition.limit * this.state.condition.page; + if (endNum > result.total) { + endNum = result.total; + } const pageNavi = this.renderPageNavi(result); let evenodd = 'even'; const items = result.data.map((item: Item) => {