Skip to content

Commit

Permalink
show error
Browse files Browse the repository at this point in the history
  • Loading branch information
kkuepper committed Feb 19, 2024
1 parent db56204 commit 32db960
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion client/app/scripts/controllers/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ angular.module('bmmApp')
$scope.load = true;
$scope.data = null;
$scope.selectedChurch = null;
$scope.failed = false;

$(window).off('scrollBottom');

var load = function(churchId) {
_api.churchStatisticsGet(churchId).done(function (data) {
console.log("loaded data", data);
$scope.data = data;
$scope.load = false;
$scope.selectedChurch = {id: data.church_id, name: data.church};
}).fail(function(data){
$scope.failed = true;
$scope.load = false;
$scope.message = data.responseJSON?.message ?? "an unexpected error occurred";
});
};
load("");
Expand Down
7 changes: 6 additions & 1 deletion client/app/views/pages/statistics.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

<div ng-show="!load">
<div ng-show="failed">
<p>An error occurred:</p>
<p>{{message}}</p>
</div>

<div ng-show="!load && !failed">
<h3>Message to the Romans</h3>

<div ng-show="data.available_churches">
Expand Down

0 comments on commit 32db960

Please sign in to comment.