cupOJoseph / crypto-zoo

1 stars 2 forks source link

for MakeDonation event, get original donation ID to decide type of token #32

Closed cupOJoseph closed 5 years ago

cupOJoseph commented 5 years ago

web3 calls getDonation(donationID) //contract call type of token = response._originalDonationId //js to response

cupOJoseph commented 5 years ago

This is an api issue. adds the only web3 call in the backend, should be fast enough since it is a free READ only call.

cupOJoseph commented 5 years ago

Error: connection not open

cupOJoseph commented 5 years ago
        var fundraiser_id = 1;
        //TODO: get "original fundraiser" for token ID
        contract.methods.getDonation(tokenID).call().then(function(tokeninfo){

       //do what you want when it's finish and everything ok .. with the result
        console.log(tokeninfo);

      }).catch(function(error){
       // it's finshed but with error
          console.log("web3 getting donation info error:");
          console.log(error);
      });
cupOJoseph commented 5 years ago

resolved in #62