Commit 4d60bfc8 authored by dev0tion's avatar dev0tion

Adjust create component to new API specs

parent 81d57854
...@@ -26,6 +26,6 @@ ...@@ -26,6 +26,6 @@
<label>Mnemonic:</label> <label>Mnemonic:</label>
</div> </div>
<div> <div>
<label>{{body}}</label> <label>{{responseMessage}}</label>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -2,7 +2,7 @@ import { Component, Injectable } from '@angular/core'; ...@@ -2,7 +2,7 @@ import { Component, Injectable } from '@angular/core';
import { ApiService } from '../../shared/api/api.service'; import { ApiService } from '../../shared/api/api.service';
import { SafeCreation } from '../../shared/safe-creation'; import { WalletCreation } from '../../shared/wallet-creation';
import { Mnemonic } from '../../shared/mnemonic'; import { Mnemonic } from '../../shared/mnemonic';
@Component({ @Component({
...@@ -14,19 +14,15 @@ import { Mnemonic } from '../../shared/mnemonic'; ...@@ -14,19 +14,15 @@ import { Mnemonic } from '../../shared/mnemonic';
export class CreateComponent { export class CreateComponent {
constructor(private apiService: ApiService) {} constructor(private apiService: ApiService) {}
private newWallet: SafeCreation; private newWallet: WalletCreation;
private body: string; private responseMessage: string;
private createWallet(password: string, network: string, folderPath: string, name: string, ) { private createWallet(password: string, network: string, folderPath: string, name: string, ) {
this.newWallet.password = password; this.newWallet.password = password;
this.newWallet.network = network; this.newWallet.network = network;
this.newWallet.folderPath = folderPath;
this.newWallet.name = name;
this.apiService this.apiService
.createWallet(this.newWallet) .createWallet(this.newWallet)
//.map(res => {let body = res.text()}) .subscribe((response: string) => this.responseMessage = response);
.subscribe((response: string) => this.body = response,
() => console.log("createWallet() complete from init"));
} }
} }
export class WalletCreation {
password: string;
network: string;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment