Merge branch 'ben/fix/error-messages' into ben/feature/push-notifications

This commit is contained in:
Ben Goldsworthy 2020-11-28 19:37:00 +00:00
commit a4edd74fcc
3 changed files with 20 additions and 2 deletions

View file

@ -103,7 +103,18 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
}) })
export class AppModule { export class AppModule {
constructor () { constructor (
private api: ApiService,
) {
this.api.checkDatabaseConnection().subscribe(
result => {
},
error => {
document.location = '#/500';
throw new Error('Server connection fail');
}
);
if (environment.enableAnalytics) { if (environment.enableAnalytics) {
(<any>window).ga('create', environment.analyticsKey, 'auto'); (<any>window).ga('create', environment.analyticsKey, 'auto');
} }

View file

@ -5,7 +5,7 @@
<div class="clearfix"> <div class="clearfix">
<h1 class="float-left display-3 mr-4">500</h1> <h1 class="float-left display-3 mr-4">500</h1>
<h4 class="pt-3">Houston, we have a problem!</h4> <h4 class="pt-3">Houston, we have a problem!</h4>
<p class="text-muted">The page you are looking for is temporarily unavailable.</p> <p class="text-muted">Server connection unavailable.</p>
</div> </div>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-primary btn-lg" type="button"(click)="goBack()">Go Back</button> <button class="btn btn-primary btn-lg" type="button"(click)="goBack()">Go Back</button>

View file

@ -41,6 +41,13 @@ export class ApiService {
localStorage.removeItem('sessionKey'); localStorage.removeItem('sessionKey');
} }
public checkDatabaseConnection() {
return this.http.post<any>(
this.apiUrl,
null
);
}
public register(data) { public register(data) {
return this.http.post<any>( return this.http.post<any>(
this.apiUrl + '/register', this.apiUrl + '/register',