feat(EnvelopeTableComponent): Methode onToggleExpandedRow hinzugefügt, um Empfänger anhand der Umschlag-UUID abzurufen und anzuzeigen

This commit is contained in:
Developer 02 2024-09-06 13:52:47 +02:00
parent cfa40e640b
commit e1d7d0e141
2 changed files with 12 additions and 4 deletions

View File

@ -51,8 +51,17 @@ export class EnvelopeTableComponent implements AfterViewInit {
@ViewChild(ReceiverStatusTableComponent) rsTable!: ReceiverStatusTableComponent @ViewChild(ReceiverStatusTableComponent) rsTable!: ReceiverStatusTableComponent
onToggleExpandedRow(element: any, event: Event) { onToggleExpandedRow: (envelope: any, event: Event) => void = (envelope, event) => {
console.log(element) if (envelope === null || envelope === undefined)
return;
var uuid: string = envelope.uuid;
this.erService.getReceiverByEnvelope(uuid).subscribe({
next: rcv => {
console.log(rcv);
this.rsTable.data = rcv;
}
});
} }
private eService: EnvelopeService = inject(EnvelopeService); private eService: EnvelopeService = inject(EnvelopeService);
@ -63,6 +72,5 @@ export class EnvelopeTableComponent implements AfterViewInit {
async ngAfterViewInit() { async ngAfterViewInit() {
this.data = await this.eService.getEnvelopeAsync(); this.data = await this.eService.getEnvelopeAsync();
this.rsTable.data = await this.erService.getEnvelopeReceiverAsync();
} }
} }

View File

@ -38,7 +38,7 @@ export class EnvelopeReceiverService {
return this.http.get<any>(`${this.url}/receiver`, { params }); return this.http.get<any>(`${this.url}/receiver`, { params });
} }
getReceiverByEnvelopAsync(uuid: string): Promise<any> { getReceiverByEnvelopeAsync(uuid: string): Promise<any> {
return firstValueFrom(this.getReceiverByEnvelope(uuid)); return firstValueFrom(this.getReceiverByEnvelope(uuid));
} }
} }