Skip to content

Commit

Permalink
Bug fixes on history page. Default to viewType "All". Support capital OK
Browse files Browse the repository at this point in the history
  • Loading branch information
netwolfuk committed Aug 4, 2020
1 parent 0c53b6b commit 99409d2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ protected ModelAndView doHandle(HttpServletRequest request, HttpServletResponse
params.put("okCount", myWebHookHistoryRepository.getOkCount());
params.put("skippedCount", myWebHookHistoryRepository.getDisabledCount());
params.put("totalCount", myWebHookHistoryRepository.getTotalCount());

String viewType = request.getParameter(PARAM_NAME_VIEW) != null ? request.getParameter(PARAM_NAME_VIEW) : "All";

if (isGet(request) && request.getParameter(PARAM_NAME_VIEW) != null) {
if (isGet(request)) {
int pageNumber = getPageNumber(request);
int pageSize = getPageSize(request);
params.put("page", pageNumber);
PagedList<WebHookHistoryItem> pagedList;
switch ( request.getParameter(PARAM_NAME_VIEW)) {
switch ( viewType ) {
case "errors":
case "Errors":
pagedList = myWebHookHistoryRepository.findHistoryErroredItems(pageNumber, pageSize);
Expand All @@ -71,6 +73,7 @@ protected ModelAndView doHandle(HttpServletRequest request, HttpServletResponse
break;
case "ok":
case "Ok":
case "OK":
pagedList = myWebHookHistoryRepository.findHistoryOkItems(pageNumber, pageSize);
params.put(PARAM_NAME_COUNT_CONTEXT, "OK");
break;
Expand Down

0 comments on commit 99409d2

Please sign in to comment.