]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts
LP1907286 Staff catalog sets last retrieved record
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / catalog / catalog.component.ts
1 import {Component, OnInit} from '@angular/core';
2 import {IdlObject} from '@eg/core/idl.service';
3 import {StaffCatalogService} from './catalog.service';
4 import {BasketService} from '@eg/share/catalog/basket.service';
5
6 @Component({
7   templateUrl: 'catalog.component.html'
8 })
9 export class CatalogComponent implements OnInit {
10
11     constructor(
12         private basket: BasketService,
13         private staffCat: StaffCatalogService
14     ) {}
15
16     ngOnInit() {
17         // Create the search context that will be used by all of my
18         // child components.  After initial creation, the context is
19         // reset and updated as needed to apply new search parameters.
20         this.staffCat.createContext();
21
22         // Subscribe to these emissions so that we can force
23         // change detection in this component even though the
24         // hold-for value was modified by a child component.
25         this.staffCat.holdForChange.subscribe(() => {});
26     }
27
28     // Returns the 'au' object for the patron who we are
29     // trying to place a hold for.
30     holdForUser(): IdlObject {
31         return this.staffCat.holdForUser;
32     }
33
34     clearHoldPatron() {
35         this.staffCat.clearHoldPatron();
36     }
37 }
38