Improved API responses

This commit is contained in:
rr-
2015-08-03 18:54:10 +02:00
parent 5a537ba168
commit b3def7fc21
49 changed files with 75 additions and 76 deletions

View File

@ -114,7 +114,14 @@ App.Presenters.PagerPresenter = function(
updateCallback($page, response);
refreshPageList();
if (!response.entities.length) {
var entities =
response.json.posts ||
response.json.users ||
response.json.comments ||
response.json.tags;
if (!entities.length) {
messagePresenter.showInfo($messages, 'No data to show');
if (pager.getVisiblePages().length === 1) {
hidePageList();
@ -125,7 +132,7 @@ App.Presenters.PagerPresenter = function(
showPageList();
}
if (pager.getPage() < response.totalPages) {
if (pager.getPage() < pager.getTotalPages()) {
attachNextPageLoader();
}