I have a user's item that needs to be validated 10 times (variable value) by other users. And when the item is validated 10 times, the item's owner gets a number of points.
But my problem is, if 400 users validate at the same time the item, I will not be able to validate it only once.
e.g:
- a request passes
nbValidation >= 10 && validated === false-> patch{ validated: true }and give to the user 10 points - a second request passes at the same time
nbValidation >= 10 && validated === false-> patch{ validated: true }and give to the user 10 points again
So the user has 20 points instead of 10 points.
I'm using feathersJs
Have you any idea to avoid this problem?
Thanks