mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 11:10:57 +01:00
Added Error Handling when no more commits are available
This commit is contained in:
@@ -55,6 +55,7 @@ class NetworkController implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
$nextPageUrl = null;
|
||||
|
||||
if ($pager['last'] !== $pager['current']) {
|
||||
$nextPageUrl = $app['url_generator']->generate(
|
||||
'networkData',
|
||||
@@ -65,6 +66,18 @@ class NetworkController implements ControllerProviderInterface
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// when no commits are given, return an empty response - issue #369
|
||||
if( count($commits) === 0 ) {
|
||||
return $app->json( array(
|
||||
'repo' => $repo,
|
||||
'commitishPath' => $commitishPath,
|
||||
'nextPage' => null,
|
||||
'start' => null,
|
||||
'commits' => $jsonFormattedCommits
|
||||
), 200
|
||||
);
|
||||
}
|
||||
|
||||
return $app->json( array(
|
||||
'repo' => $repo,
|
||||
|
||||
@@ -351,7 +351,7 @@
|
||||
}
|
||||
|
||||
function handleNoAvailableData() {
|
||||
console.log('No Data available');
|
||||
window.console && console.log('No (more) Data available');
|
||||
}
|
||||
|
||||
var awaitedParents = {};
|
||||
|
||||
Reference in New Issue
Block a user