Gabriele Ferro Home

Added Like & Dislike Rating system in my project with Mongoose

Day 85: 19 November 2020

OpenClassRooms 6th project

Small recap:

12 Days ago I started this project.

10 Days ago I written the CRUD operations.

9 Days ago I optimized my project

6-7 Days ago I tried to connect the front end with the back end... CATASTROPHE!!!!

4 days ago I tried to undo a few changes...

2 Days ago I finally found the bugs

Users can now register an account, their password is crypted and it uses a token for authentication

Registered users only can login

Registered users can share their favourite sauce

Registered users can see all the sauces. If they wish, they can modify the sauce they have created and remove it from the system.

Once the basic CRUD operations are coded, the front end and the back end are in sync, I can now write the middleware that allows users to like or dislike a sauce.

**Today’s Progress:**

I had already foreseen an afternoon of desperation and hair pulling… So I had allocated my daily study time to devote it solely to writing this feature.

At first I created a bug because I had forgotten to check if the user had already expressed his satisfaction.

So I added the user to an array of people that liked or disliked the sauce... et voilà!

It took me less than two hours!

I used two mongoose methods:

**Thoughts:**

I know well that the front end is not the best of aesthetics and elegance but in this project I have to write only the back end.

If I want to improve my skills:

I must necessarily learn how to use the mongoose library.

It allows me to run queries by writing simpler and shorter code!

**Link to tweet:**

[twitter-follow screen_name='20Gabriele20']

June 2024
MTWTFSS
 12
3456789
10111213141516
17181920212223
24252627282930

Archives

Gabriele Ferro Home
Copyright © Ferro Gabriele. All rights reserved.