Squash Tomato Journal — November 18, 2017–02:00

Chris Johnson
The Squash and the Tomato
1 min readNov 19, 2017
  1. Refactored all my client-side JavaScript functions to be pure.
  2. Added list functionality to my Squash Tomato documentation.
  3. Removed the /home route from the site, which took users to their list.
  4. Added route functionality for /my-lists, which finds all list a user is related to, whether the owner or just a member of a list, adds a list.url and list.name if one didn’t exist (explained below), and renders all the found lists as cards.
  5. Updated all User model documents in the ‘user’ collection: copied the user.email, user.name, and user.list to a new collection, ‘lists’. Since the User model didn’t have the ability to store additional lists besides the default list provided, I could assume all the lists from the User model documents were single user lists where the user was the owner; therefore, I copied the user.email to list.owner and user.list to list.list. I used user.name to make the list url if it didn’t exist. If a list.name didn’t exist, which it didn’t for any, I simply used a list-[index] method of migrating lists, which users can change in the /my-lists/list options.
  6. Added route functionality for the lists custom url, which was the name of the owner + the last 4 of their _id.

--

--

Chris Johnson
The Squash and the Tomato

Full-stack Surgeon (Design, Vue, Node, mongoDB), knowledge seeker, world dominator, Harry Potter and anime addict, volleyball player, and unfiltered.