FullstackRustDemo icon indicating copy to clipboard operation
FullstackRustDemo copied to clipboard

Implement upvotes and downvotes for the forum system

Open hgzimmerman opened this issue 7 years ago • 0 comments

This will require 2 separate junction tables, one for upvotesand one for downvotes.

The junction will be useruuid + postuuid. When upvoting or downvoting the uuid belonging to the user that initiated the action will be added to the respective junction table. When calculating the votes, just use the count diesel DSL method. The belongingTo/groupBy diesel DSL will make it efficient to get these for multiple posts at once.

Return both the upvotes and downvotes and let the client determine how to display an aggregate.

hgzimmerman avatar Jun 10 '18 16:06 hgzimmerman