feat(api): fixed create role payload check
This commit is contained in:
parent
90d58a9972
commit
40e894cf80
1 changed files with 2 additions and 1 deletions
|
|
@ -20,7 +20,8 @@ def get_roles(context):
|
|||
@app.route('/client/roles', methods=['POST', 'PUT'])
|
||||
def add_role(context):
|
||||
data = app.current_request.json_body
|
||||
data = roles.create(tenant_id=context['tenantId'], user_id=context['userId'], **data)
|
||||
data = roles.create(tenant_id=context['tenantId'], user_id=context['userId'], name=data["name"],
|
||||
description=data.get("description"), permissions=data["permissions"])
|
||||
if "errors" in data:
|
||||
return data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue