You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love your clean and minimalist design. If I had one criticism it is careful to not be too sparse. Information density is very important for web design.
You can use {timestamps: true} to have mongoose handle createdAt and updatedAt for you automatically.
"checklistId" is more conventionally just => "checklist". But either way :D
Instead of "completed" as a boolean, make it "completedAt" and make it a datetime. Then you have both if it is completed and when in one piece of data.
Careful with "todoItems", this should be => "todos" and be an array of Schema.type.ObjectId.
Same for "OwnerUserId" => "owner" or even just "user" to be clearer.
reminder to gitignore your node_modules
You require bcrypt in your app.js but don't use it. so you can just remove it. Only require things you use. YAGNI
I really like your code. So clean, and you use one-liners the same way I do.
Review and use const, var, and let consistently and correctly. Lots of extra var's around.
Your controller code could be cleaner though, imo, put more on one line.
If you fix your naming of your associated models you can use populate() to clean up your queries in your controllers.
Where are your socket calls?
If you use .sort() make sure to chain it and then finish with a .then() like this: .find().sort().then().catch()
Main things are to clean up your naming of attributes, timestamps, and especially the naming of associated resources. I'd also like to see the sockets but couldn't find. Otherwise looking good.
The text was updated successfully, but these errors were encountered:
Thank you for the super insightful and actionable feedback @ajbraus - also really appreciate the recommendations. I just looked up populate() and it looks great!
I haven't replaced current GET / POST requests with sockets yet, but planning on doing so shortly.
app.js
but don't use it. so you can just remove it. Only require things you use. YAGNIconst
,var
, andlet
consistently and correctly. Lots of extravar
's around.populate()
to clean up your queries in your controllers..sort()
make sure to chain it and then finish with a.then()
like this:.find().sort().then().catch()
Main things are to clean up your naming of attributes, timestamps, and especially the naming of associated resources. I'd also like to see the sockets but couldn't find. Otherwise looking good.
The text was updated successfully, but these errors were encountered: