greenlight
greenlight copied to clipboard
RoomLimit Backend Check
Description
- Check when the room is created if the limit has been reached or passed. IF so, then return error and don't create new room
Testing Steps
- Change room limit for signed in role
- Try to create more rooms than the limit
Screenshots (if appropriate):
TODO
- How to return a custom error so that it can be checked in the mutation onError to return specific toast
- RSpec
~~Waiting on #3956~~
To solve your issue with the permission checker and the error stuff, I would move away from the ensure_authorized pattern and just add a check to the top of the create method .
Basically
def create
return render_error, error: "RoomLimitError" if PermissionChecker.....
end







