Skip to content

Commit

Permalink
Merge pull request #51 from krishnaacharyaa/BugFix-40-Krishna
Browse files Browse the repository at this point in the history
[BugFix - getDonators and donateToCampaign give errors #40]
  • Loading branch information
adrianhajdin authored Jul 3, 2023
2 parents a554d7e + 95aaa03 commit 2f8d4b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/context/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export const StateContextProvider = ({ children }) => {
}

const donate = async (pId, amount) => {
const data = await contract.call('donateToCampaign', pId, { value: ethers.utils.parseEther(amount)});
const data = await contract.call('donateToCampaign', [pId], { value: ethers.utils.parseEther(amount)});

return data;
}

const getDonations = async (pId) => {
const donations = await contract.call('getDonators', pId);
const donations = await contract.call('getDonators', [pId]);
const numberOfDonations = donations[0].length;

const parsedDonations = [];
Expand Down

0 comments on commit 2f8d4b8

Please sign in to comment.