I am trying to decode the jsonified response recieved from my flask backend as shown below:
if success_flag:
waterdetails = res["Transaction_chain"]
print(waterdetails)
senderObject.mine_block(waterdetails)
#print(senderObject.chain)
recieveObject.mine_block(waterdetails)
#print(recieveObject.chain)
print("Here as well")
if senderObject.is_chain_valid() and recieveObject.is_chain_valid():
adminDataBase.requestUpdate("_id",ObjectId(senderID),
{"Transaction_So_Far":senderObject.chain})
adminDataBase.requestUpdate("_id",ObjectId(recieverID),
{"Transaction_So_Far":recieveObject.chain})
print("Success!!!!!")
return(jsonify({"Yes":"Transaction Successful!"}))
Here is my React JS onClick function to pick the response:
onClick={async(e)=>{
e.preventDefault();
let pwd = prompt('Please enter your Password to confirm!');
const JSONString = {
email:props.Email,
_id:details._id,
Credits:details.Credits,
password:pwd
}
const response = await fetch('http://localhost:5000/make-a-transaction',{
method: 'POST',
headers:{
'Content-Type':'application/json'
},
body:JSON.stringify(JSONString)
});
console.log("Hello "+response.json());
}}
here is my console of backend:
And here is my console.log output:
Can someone help me with decoding the json in the right way so that I get my response message and body back?

