Copy contract data into new object to avoid object is not extensible error
It seems the new ethers.js version returns contract data as a non- extensible object. We have to clone it before adding the IPFS data.
This commit is contained in:
@@ -9,7 +9,8 @@ class Contributor extends Record {
|
||||
|
||||
getById (id) {
|
||||
return this.functions.getContributorById(id)
|
||||
.then(data => {
|
||||
.then(contractData => {
|
||||
let data = {...contractData};
|
||||
data.balanceInt = formatKredits(data.balance);
|
||||
return this.ipfs.catAndMerge(data, ContributorSerializer.deserialize);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user