Created utils folder which holds funcs to be called within the flask routes, added pseudo code to streams.py and user.py which are untested, data still needs to be jsonified to be sent to React
This commit is contained in:
19
web_server/utils/utils.py
Normal file
19
web_server/utils/utils.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from database.database import Database
|
||||
|
||||
def categories():
|
||||
"""
|
||||
Returns all possible streaming categories
|
||||
"""
|
||||
db = Database()
|
||||
cursor = db.create_connection()
|
||||
all_categories = cursor.execute("SELECT * FROM categories").fetchall()
|
||||
return all_categories
|
||||
|
||||
def tags():
|
||||
"""
|
||||
Returns all possible streaming tags
|
||||
"""
|
||||
db = Database()
|
||||
cursor = db.create_connection()
|
||||
all_tags = cursor.execute("SELECT * FROM tags").fetchall()
|
||||
return all_tags
|
||||
Reference in New Issue
Block a user