greenlight icon indicating copy to clipboard operation
greenlight copied to clipboard

RoomLimit Backend Check

Open hadicheaito1 opened this issue 3 years ago • 2 comments

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

hadicheaito1 avatar Oct 06 '22 16:10 hadicheaito1

~~Waiting on #3956~~

hadicheaito1 avatar Oct 06 '22 16:10 hadicheaito1

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

farhatahmad avatar Oct 20 '22 17:10 farhatahmad

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Oct 24 '22 20:10 sonarqubecloud[bot]