Hi Matthew, so in fixing this bug I came across a few additional ones which I believe I also fixed. Basically, what I think was causing the original bug (and please let me know if you're still getting it) is that I needed to change the rest of the code away from depending on id being stored in the database as a document. The next bug that I encountered was that forEach was undefined when it was being called on completed. The problem here is that new tasks were not being created with an empty completed array. completed was simply undefined. Thus, calling forEach on an undefined object threw that error. To fix this, I edited the addTask mutation to create new tasks with empty arrays from completed and confirmed tasks in addition to the array for assigned tasks.
Hi Matthew, so in fixing this bug I came across a few additional ones which I believe I also fixed. Basically, what I think was causing the original bug (and please let me know if you're still getting it) is that I needed to change the rest of the code away from depending on
id
being stored in the database as a document. The next bug that I encountered was thatforEach
was undefined when it was being called oncompleted
. The problem here is that new tasks were not being created with an emptycompleted
array.completed
was simply undefined. Thus, callingforEach
on an undefined object threw that error. To fix this, I edited theaddTask
mutation to create new tasks with empty arrays from completed and confirmed tasks in addition to the array for assigned tasks.