X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-frontend%2Fsrc%2Fapp%2Fapp-control%2Fapp-control.component.ts;fp=webapp-frontend%2Fsrc%2Fapp%2Fapp-control%2Fapp-control.component.ts;h=341754b08d62751bc403e1a7fc676f2ef5007d98;hb=fa50e55b6e8977ad0a6a28096fe58fb54924ca2b;hp=b172152fb43c7092203a8b56fc910b54b45802ae;hpb=4d3a7c62ddcab6abc5ca45e6cabc90258025a768;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/app-control/app-control.component.ts b/webapp-frontend/src/app/app-control/app-control.component.ts index b172152f..341754b0 100644 --- a/webapp-frontend/src/app/app-control/app-control.component.ts +++ b/webapp-frontend/src/app/app-control/app-control.component.ts @@ -18,6 +18,7 @@ * ========================LICENSE_END=================================== */ import { Component, OnInit, ViewChild } from '@angular/core'; +import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; import { MatSort } from '@angular/material/sort'; import { Router } from '@angular/router'; import { XappControlRow } from '../interfaces/app-mgr.types'; @@ -67,21 +68,24 @@ export class AppControlComponent implements OnInit { } } - undeployApp(app: XappControlRow): void { + onUndeployApp(app: XappControlRow): void { this.confirmDialogService.openConfirmDialog('Are you sure you want to undeploy xApp ' + app.xapp + '?') - .afterClosed().subscribe(res => { + .afterClosed().subscribe( (res: boolean) => { if (res) { this.appMgrSvc.undeployXapp(app.xapp).subscribe( - response => { + ( httpResponse: HttpResponse) => { this.dataSource.loadTable(); - switch (response.status) { + switch (httpResponse.status) { case 200: this.notificationService.success('xApp undeployed successfully!'); break; default: this.notificationService.warn('xApp undeploy failed.'); } - } + }, + ( (error: HttpErrorResponse) => { + this.notificationService.warn(error.message); + }) ); } });