Here is a Rest Api method that sets the user rating. The database table contains the composite primary key: user_id
+ rate_id
.
When user tries to set the same rating the framework throws an exception. I catch it and return response.
How to handle such these cases and make the method idempotent?