#10 Started on creating front end pages for the admin
This commit is contained in:
@ -63,6 +63,12 @@ class UserController(DatabaseController):
|
||||
|
||||
return self.convert_type(self.get_one(query, params))
|
||||
|
||||
def read_all(self) -> list[User] | None:
|
||||
params = []
|
||||
query = """ SELECT * FROM Users """
|
||||
|
||||
return self.get_many(query, params)
|
||||
|
||||
def update(self):
|
||||
print("Doing work")
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
""" The user controller to manage all of the user related endpoints
|
||||
""" The admin controller to manage all of the admin related endpoints
|
||||
in the web app
|
||||
"""
|
||||
from flask import Blueprint
|
||||
|
||||
# from flask import render_template
|
||||
from flask import render_template, Blueprint
|
||||
|
||||
from controllers.database.user import UserController
|
||||
|
||||
# Blueprint to append user endpoints to
|
||||
blueprint = Blueprint("admin", __name__, url_prefix="/admin")
|
||||
@ -18,4 +19,8 @@ def main_admin():
|
||||
@blueprint.route('/users/')
|
||||
def admin_users():
|
||||
""" Endpoint responsible for managing a users permissions """
|
||||
return "Hello, Worlds"
|
||||
# Get all users to create admin table on frontend
|
||||
db = UserController()
|
||||
users = db.read_all()
|
||||
|
||||
return render_template("index.html", content="admin.html", users=users)
|
||||
|
Reference in New Issue
Block a user