import {Component, OnInit, ViewChild} from '@angular/core';
+import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import { NgbTabChangeEvent } from '@ng-bootstrap/ng-bootstrap';
import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
import {GridComponent} from '@eg/share/grid/grid.component';
import {PatronService} from '@eg/staff/share/patron.service';
import {PcrudService} from '@eg/core/pcrud.service';
import {ReservationsGridComponent} from './reservations-grid.component';
-import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {ServerStoreService} from '@eg/core/server-store.service';
+import {ToastService} from '@eg/share/toast/toast.service';
@Component({
selector: 'eg-manage-reservations',
private router: Router,
private pcrud: PcrudService,
private patron: PatronService,
- private store: ServerStoreService
+ private store: ServerStoreService,
+ private toast: ToastService
) {
// This is in the constructor, because we need it first thing in ngOnInit
this.chooseAppropriateFilter = () => {
this.patron.bcSearch(this.patronBarcode).subscribe(
(response) => {
this.router.navigate(['/staff', 'booking', 'manage_reservations', 'by_patron', response[0].id]);
+ }, (error) => {
+ this.toast.danger('No patron found with this barcode');
});
} else {
this.removeFilters();