const copy = result.copy;
const volume = result.volume;
const circ = result.circ;
- const parent_circ = result.parent_circ;
+ const hold = result.hold;
+ const nonCatCirc = (result as CheckoutResult).nonCatCirc;
let promise = Promise.resolve();
+ if (!result.patron) {
+ let patronId;
+ if (hold) {
+ patronId = hold.usr();
+ } else if (circ) {
+ patronId = circ.usr();
+ } else if (nonCatCirc) {
+ patronId = nonCatCirc.patron();
+ }
+
+ if (patronId) {
+ promise = promise.then(_ => {
+ return this.pcrud.retrieve('au', patronId)
+ .toPromise().then(p => result.patron = p);
+ });
+ }
+ }
+
+
if (result.record) {
result.title = result.record.title();
result.author = result.record.author();
|| checkin.patron.pref_first_given_name()
|| checkin.patron.pref_second_given_name()">
Preferred name:
- {{checkin.patron.pref_family_name || checkin.patron.family_name}},
- {{checkin.patron.pref_first_given_name || checkin.patron.first_given_name}}
- {{checkin.patron.pref_second_given_name}}
+ {{checkin.patron.pref_family_name() || checkin.patron.family_name()}},
+ {{checkin.patron.pref_first_given_name() || checkin.patron.first_given_name()}}
+ {{checkin.patron.pref_second_given_name()}}
</div>
</div>
<div>
import {Component, OnInit, Output, Input, ViewChild, EventEmitter} from '@angular/core';
import {empty, of, from, Observable} from 'rxjs';
-import {concatMap} from 'rxjs/operators';
+import {tap, concatMap} from 'rxjs/operators';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {PcrudService} from '@eg/core/pcrud.service';
import {OrgService} from '@eg/core/org.service';