extends DialogComponent implements OnInit {
@Input() patronId: number;
- @Input() penaltyNote: string = '';
+ @Input() penaltyNote = '';
ALERT_NOTE = 20;
SILENT_NOTE = 21;
STAFF_CHR = 25;
- staffInitials: string = '';
+ staffInitials: string;
penaltyTypes: IdlObject[];
penaltyTypeFromSelect = '';
penaltyTypeFromButton;
ngOnInit() {
this.onOpen$.subscribe(_ =>
- this.init().subscribe(_ => this.dataLoaded = true));
+ this.init().subscribe(__ => this.dataLoaded = true));
}
init(): Observable<any> {
.pipe(tap(ptypes => {
this.penaltyTypes =
ptypes.sort((a, b) => a.label() < b.label() ? -1 : 1);
- }))
+ }));
}));
}
apply() {
- const pen = this.idl.create('ausp');
- pen.usr(this.patronId);
- pen.org_unit(this.auth.user().ws_ou());
- pen.set_date('now');
- pen.staff(this.auth.user().id());
+ const pen = this.idl.create('ausp');
+ pen.usr(this.patronId);
+ pen.org_unit(this.auth.user().ws_ou());
+ pen.set_date('now');
+ pen.staff(this.auth.user().id());
- pen.note(this.initials ?
+ pen.note(this.initials ?
`${this.noteText} [${this.initials}]` : this.noteText);
pen.standing_penalty(
this.penaltyTypeFromSelect || this.penaltyTypeFromButton);
- this.net.request(
- 'open-ils.actor',
- 'open-ils.actor.user.penalty.apply',
- this.auth.token(), pen
+ this.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.user.penalty.apply',
+ this.auth.token(), pen
).subscribe(resp => {
const e = this.evt.parse(resp);
if (e) {