You'll see your TODOs, but all are "not completed"
I've verified that they're all set to completed=false when reading in from the DWN onBeforeMount.
I believe the problem is in toggleTodoComplete, where we call web5.dwn.records.write. I'm expecting a Record object to be returned but it's coming back as undefined?
const { returnedRecordFromWrite } = await web5.dwn.records.write(myDid.id, {
author : myDid.id,
data : updatedTodoData,
message : {
recordId : toggledTodo.id,
}
});
/**
* ALR Debugging toggling TODO, not persisted in DWN
*/
// Why is this returning "undefined"? I don't think the write operation is overwriting the info in the DWN - ALR
// Using docs from https://github.com/TBD54566975/web5-js#web5dwnrecordswritetarget-request
console.log("Record object returned from dwn.records.write: " + returnedRecordFromWrite);
To reproduce:
I've verified that they're all set to
completed=false
when reading in from the DWNonBeforeMount
.I believe the problem is in
toggleTodoComplete
, where we callweb5.dwn.records.write
. I'm expecting aRecord
object to be returned but it's coming back asundefined
?