Update according to suggestions

This commit is contained in:
2018-04-08 01:25:59 +02:00
parent a0dd8b925b
commit 576313a7b0
+5 -2
View File
@@ -118,7 +118,7 @@ export default Service.extend({
getContributorById(id) { getContributorById(id) {
return this.get('contributorsContract') return this.get('contributorsContract')
.then((contract) => contract.getContributorById(id)) .then((contract) => contract.getContributorById(id))
.then(this.replaceIpfsHash) .then(this.reassembleIpfsHash)
// Set basic data // Set basic data
.then(({ account: address, balance, ipfsHash, isCore }) => { .then(({ account: address, balance, ipfsHash, isCore }) => {
let isCurrentUser = this.get('currentUserAccounts').includes(address); let isCurrentUser = this.get('currentUserAccounts').includes(address);
@@ -157,9 +157,12 @@ export default Service.extend({
}); });
}, },
replaceIpfsHash(data) { reassembleIpfsHash(data) {
let { ipfsHash: digest, hashFunction, hashSize } = data; let { ipfsHash: digest, hashFunction, hashSize } = data;
data.ipfsHash = fromBytes32({ digest, hashFunction, hashSize }); data.ipfsHash = fromBytes32({ digest, hashFunction, hashSize });
delete data.hashFunction;
delete data.hashSize;
return data; return data;
}, },