}
}
return '';
- }
+ };
this.cellTextGenerator = {
title: row => row.title,
.catch(msg => {
this.reportError(msg);
- console.debug('Payment Canceled or Failed:', msg)
+ console.debug('Payment Canceled or Failed:', msg);
})
.finally(() => {
this.applyingPayment = false;
import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {tap} from 'rxjs/operators';
import {OrgService} from '@eg/core/org.service';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {NetService} from '@eg/core/net.service';
return Object.values(this.searches).filter(dupe => dupe.count > 0);
}
- checkDupes(category: string, search: PatronSearchFieldSet) {
+ checkDupes(category: string, search: PatronSearchFieldSet): Promise<any> {
- this.net.request(
+ return this.net.request(
'open-ils.actor',
'open-ils.actor.patron.search.advanced',
this.auth.token(),
1000, // limit
null, // sort
true // as id
- ).subscribe(ids => {
+ ).pipe(tap(ids => {
ids = ids.filter(id => Number(id) !== this.patronId);
this.searches[category] = {
category: category as SearchCategory,
search: search,
json: JSON.stringify(search)
};
- });
+ })).toPromise();
}
checkAddressAlerts(patron: IdlObject, addr: IdlObject) {
// false otherwise.
val = Boolean((val + '').match(/^t/i));
}
- this.userSettings[stype.name()] = val
+ this.userSettings[stype.name()] = val;
}
}
});
});
}
- dupeValueChange(name: string, value: any) {
+ dupeValueChange(name: string, value: any): Promise<any> {
if (name.match(/phone/)) { name = 'phone'; }
if (name.match(/name/)) { name = 'name'; }
break;
}
- this.toolbar.checkDupes(name, search);
+ return this.toolbar.checkDupes(name, search);
}
showField(field: string): boolean {