const confirmDialog = this.dialog.open(ConfirmModalComponent, { width: '350px', data: {title: `Czy na pewno chcesz anulować zamówienie numer: ${order.id}?`} }); confirmDialog.afterClosed().subscribe(result => { if (result) { this.orderService.cancelOrder(order.id) .pipe(finalize(() => this.orderService.getAllOrders())) .subscribe( () => { this.informationService.openSnackBar(`Anulowano zamówienie number: ${order.id}`); }, err => { this.informationService.displayArrayErrors(err); } ); } });