tbf-challenge / teamwork-be

This is the backend repository for teamwork
0 stars 0 forks source link

record number of likes #314

Closed beblicarl closed 1 year ago

beblicarl commented 1 year ago

Pre-Submission Checklist

Checklist:

What does this PR do?

https://github.com/tbf-challenge/teamwork-be/issues/307

How should this be manually tested?

  1. Start the server with npm run dev
  2. You will see with the logs that the migration has been added to the database
Any background context you want to provide?

What are the relevant issues?

https://github.com/tbf-challenge/teamwork-be/issues/307

beblicarl commented 1 year ago

@beblicarl, this just came to mind. we would need to add a test case for this change to ensure it works

perhaps something like it('should update likesCount column for post') where we compare the number of likes in the post_likes table to the likesCount for that post

yeah that's true.. but we still don't return the likesCount field for the post so I am sure it will be for the new issue you talked about

jocrah commented 1 year ago

yeah that's true.. but we still don't return the likesCount field for the post so I am sure it will be for the new issue you talked about

okay, however, its not related to whether something is being returned or not. Its mainly checking that an insert/delete updates the likesCount in the table. Just like you were manually checking the posts table after you inserted/deleted a post_like locally

beblicarl commented 1 year ago

yeah that's true.. but we still don't return the likesCount field for the post so I am sure it will be for the new issue you talked about

okay, however, its not related to whether something is being returned or not. Its mainly checking that an insert/delete updates the likesCount in the table. Just like you were manually checking the posts table after you inserted/deleted a post_like locally

yes please