Hi everyone,
I'm working on a review system for my app using Appwrite, and I'm facing an issue with ensuring that a user can only leave one review per product. I have a Products collection where I store the product details and a Reviews collection where users can submit their reviews. The Reviews collection has fields like userId, productId, and stars. I’ve set up a relation between the Products collection and the Reviews collection, and I’ve also implemented user authentication so users can log in.
However, I’m having trouble preventing a user from submitting multiple reviews for the same product. The permissions system seems to be the main issue, especially since I can’t use an index due to the relation between the Products and Reviews collections. I also experimented with linking users to a separate collection, but that approach doesn’t work well with the user authentication system.
Can anyone suggest the best approach to make sure that a user can only leave one review per product? I’m especially looking for a solution that integrates smoothly with Appwrite’s permissions system and user authentication. Any help or advice would be much appreciated!
Recommended threads
- Unable to activate MFA for Users - 401 (...
Good evening all, today I wanted to add MFA using TOTP but failed on activating it as the last step always returns: ```https://myappwriteinstacne.example.com/v...
- Mock Email
Hello, How can I create and use mock email addresses for testing purposes, allowing users to simulate email-based authentication or sign-in without needing real...
- How to mix Email password Login + OAuth
I am trying to create a simple login with traditional auth setup where there's a login/register for email and password and also Oauth like google, facebook and ...