Add method for delete property account

This commit is contained in:
DwCay
2022-07-04 18:02:34 +03:00
parent 0f455f126d
commit e44dfee284
4 changed files with 39 additions and 17 deletions

View File

@@ -17,23 +17,42 @@ class Store {
this.fetchNodeInfo()
reaction(() => this.tokenKey, () => fetchWrapper.getAuth('http://3.125.47.101/api/data/account', {
reaction(() => this.tokenKey, () => fetchWrapper.getAuth('http://3.125.47.101/api/data/private', {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
}).then((res) => this.userDataFetchChange(res)))
};
fetchCreateNewAccount() {
fetchWrapper.postAuth('http://3.125.47.101/api/data/account', {
fetchWrapper.postAuth('http://3.125.47.101/api/data/private', {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
}, [...this.encryptAccountData]).catch(()=>{})
};
fetchNewAccountData() {
fetchWrapper.getAuth('http://3.125.47.101/api/data/private', {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
}).then((res) => this.userDataFetchChange(res))
}
fetchChangeAccountData(data) {
fetchWrapper.postAuth('http://3.125.47.101/api/data/private', {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
}, [...data])
.then(()=>this.fetchNewAccountData())
}
userDataFetchChange(res) {
this._userData = res;
}
get userData() {
return this._userData
}
savePassPhrase(phrase) {
this._passPhrase = phrase
}
@@ -56,10 +75,6 @@ class Store {
console.log(err)
}
get userData() {
return this._userData;
}
get passPhrase() {
return 'rocket north inform swift improve fringe sweet crew client canyon bean autumn'
}