Skip to content

Commit

Permalink
Addresses bug described in #6 where the total count in the call to ac…
Browse files Browse the repository at this point in the history
…tion was off.
  • Loading branch information
thangnguyen17052018 committed Jan 7, 2022
1 parent 91e8bbf commit bc72659
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ public String index(Model model) {
ctaBuilder.append(", ");
}
}
ctaBuilder.append(" and ");
Long totalCount = flashCardService.getCurrentCount();
ctaBuilder.append(totalCount);
ctaBuilder.append(" more");
if (totalCount > AMOUNT_TO_SHOW){
ctaBuilder.append(" and ");
ctaBuilder.append(totalCount - AMOUNT_TO_SHOW);
ctaBuilder.append(" more");
}
model.addAttribute("cta", ctaBuilder.toString());
model.addAttribute("flashCardCount", totalCount);
return "index";
Expand Down

0 comments on commit bc72659

Please sign in to comment.