1 import {Component, OnInit, Input, Output, ViewChild, EventEmitter} from '@angular/core';
2 import {Observable, Observer, of} from 'rxjs';
3 import {tap} from 'rxjs/operators';
4 import {IdlObject, IdlService} from '@eg/core/idl.service';
5 import {NetService} from '@eg/core/net.service';
6 import {PcrudService} from '@eg/core/pcrud.service';
7 import {OrgService} from '@eg/core/org.service';
8 import {AuthService} from '@eg/core/auth.service';
9 import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap';
10 import {DialogComponent} from '@eg/share/dialog/dialog.component';
12 /** New hold notify dialog */
15 selector: 'eg-hold-notify-dialog',
16 templateUrl: 'notify-dialog.component.html'
18 export class HoldNotifyDialogComponent extends DialogComponent {
22 @Input() holdId: number;
25 private modal: NgbModal,
26 private idl: IdlService,
27 private auth: AuthService,
28 private pcrud: PcrudService
32 const notify = this.idl.create('ahn');
33 notify.hold(this.holdId);
34 notify.notify_staff(this.auth.user().id());
35 notify.method(this.method);
36 notify.note(this.note);
38 this.pcrud.create(notify).toPromise().then(
39 resp => this.close(resp), // new notify object
40 err => console.error('Could not create notify', err)