Browse Source

Reset server form only if server was added successfully

pull/52/head
Lombra 4 years ago
parent
commit
9e69f92507
  1. 5
      wg_dashboard_frontend/src/app/page/dashboard/add-server/add-server.component.ts

5
wg_dashboard_frontend/src/app/page/dashboard/add-server/add-server.component.ts

@ -226,18 +226,17 @@ export class AddServerComponent implements OnInit {
const idx = this.servers.indexOf(this.editServer); const idx = this.servers.indexOf(this.editServer);
this.serverAPI.editServer(this.editServer, form).subscribe((server: Server) => { this.serverAPI.editServer(this.editServer, form).subscribe((server: Server) => {
this.servers[idx] = server; this.servers[idx] = server;
this.resetForm();
}); });
} else { } else {
this.serverAPI.addServer(form).subscribe((server: Server) => { this.serverAPI.addServer(form).subscribe((server: Server) => {
this.servers.push(server); this.servers.push(server);
this.resetForm();
}); });
} }
this.resetForm();
} }
getKeyPair() { getKeyPair() {

Loading…
Cancel
Save