Closed Mojtabarezaei4 closed 1 year ago
What exactly are we validating?
If hashIds that is requesting with does match with any of rooms and also if there is a room with this Id.
This should be done in middleware pipeline.
How come this is not done in the handler? We have to decode the hashid in the handler for the database query regardless. This solution with a middleware implementation would do the same operation twice.
For that thought, we can implement a mapper that contains that conversion.
The point of the middleware pipeline will be that it runs before the request hits the handler. Then it will be no need to waste the resources.
How would this mapper work?
Alright, that looks very interesting!
Let's go with that 👍
Finished in #58
Each requested room should validate. Alternative a fluent validation.