Refactoring our to-do items
If we want to serve our to-do items, need to get our server to talk to our core, which will then get all the to-do items from our JSON file. This is where we do see some over-engineering which is our to-do item structs. Right now, just to represent an either pending or done item, we need to navigate between three structs. Our TaskStatus
enum handles the logic or serialization of the status of these structs. Right now, is a good time to look at the structs in our core
module and have a quick think on how you could represent them in a single vector to be displayed in the browser. Do not spend too much time on this as I warn you, working with the structs we have now is a fruitless task.
If you did try and work out how to convert the to-to items into a single vector, you may have considered wrapping the items in an enum, and then implementing a serialization trait to display these to-to items. This is like how we handle the writing of the to-do item to a file....