removeServer()

in app/src/app/pages/servers/servers.component.ts [56:69]


  removeServer(modal: NgbModal, server: ServerJSON) {
    this.modalService.open(modal, { centered: true }).result.then(confirm => {
      if (!confirm) { return; }

      this.mongoDb.removeServer(server.name)
        .subscribe((data: any) => {
          if (data.ok) {
            this.refresh();
          }
        });
    }, reason => {
      // Modal closed. We declare this to avoid any uncaught exception in promise
    });
  }