Skip to content
Snippets Groups Projects
Commit 99e38b84 authored by daphtya's avatar daphtya
Browse files

superadmin remove page for admins

parent 31f75c41
Branches
2 merge requests!5Develop,!2Admin endpoints
Pipeline #12528 canceled with stage
......@@ -10,8 +10,8 @@ admin_route = Blueprint('admin', __name__, template_folder="templates")
# add page for admins to watch
@admin_route.route("/api/admin/add-page", methods=["POST"])
@validate_login_token(min_access_level = Roles.SUPERADMIN, pass_user = True)
def add_page(user):
@validate_login_token(min_access_level = Roles.SUPERADMIN)
def add_page():
data = request.get_json()
admin = db.User.objects.with_id(data.get("admin_id"))
......@@ -21,4 +21,17 @@ def add_page(user):
"status":200,
"message":"Page added"
})
# remove page for admins to watch
\ No newline at end of file
# remove page for admins to watch
@admin_route.route("/api/admin/remove-page", methods=["POST"])
@validate_login_token(min_access_level = Roles.SUPERADMIN)
def remove_page():
data = request.get_json()
admin = db.User.objects.with_id(data.get("admin_id"))
admin.update(pull__page_list = db.Page.objects.with_id(data.get("page_id")))
return jsonify({
"status":200,
"message":"Page removed"
})
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment