Route dashboard API
This commit is contained in:
parent
6cc4bc36c1
commit
2ae101d5f1
@ -223,3 +223,53 @@ def index(type):
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
return json.dumps({}, indent = 2).encode()
|
||||
|
||||
@app.route('/api/dashboard/roles/list', method='POST')
|
||||
def index():
|
||||
try:
|
||||
params = request.json
|
||||
response.content_type = 'application/json'
|
||||
return json.dumps(api_dashboard_roles.roles().list(params), indent = 2).encode()
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
return json.dumps({}, indent = 2).encode()
|
||||
|
||||
@app.route('/api/dashboard/roles/add', method='POST')
|
||||
def index():
|
||||
try:
|
||||
params = request.json
|
||||
response.content_type = 'application/json'
|
||||
return json.dumps(api_dashboard_roles.roles().add(params), indent = 2).encode()
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
return json.dumps({}, indent = 2).encode()
|
||||
|
||||
@app.route('/api/dashboard/roles/edit', method='POST')
|
||||
def index():
|
||||
try:
|
||||
params = request.json
|
||||
response.content_type = 'application/json'
|
||||
return json.dumps(api_dashboard_roles.roles().edit(params), indent = 2).encode()
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
return json.dumps({}, indent = 2).encode()
|
||||
|
||||
@app.route('/api/dashboard/roles/remove', method='POST')
|
||||
def index():
|
||||
try:
|
||||
params = request.json
|
||||
response.content_type = 'application/json'
|
||||
return json.dumps(api_dashboard_roles.roles().remove(params), indent = 2).encode()
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
return json.dumps({}, indent = 2).encode()
|
||||
|
||||
@app.route('/api/dashboard/users/list', method='POST')
|
||||
def index():
|
||||
try:
|
||||
params = request.json
|
||||
response.content_type = 'application/json'
|
||||
return json.dumps(api_dashboard_users.users().list(params), indent = 2).encode()
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
return json.dumps({}, indent = 2).encode()
|
||||
|
Loading…
Reference in New Issue
Block a user