hcs-t4sg / questable

questable.vercel.app
2 stars 0 forks source link

Editing and deleting task bug #22

Closed ColeHarten closed 2 years ago

ColeHarten commented 2 years ago

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.