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:
JustIceO7
2025-01-26 06:51:24 +00:00
parent 64a5bf6f82
commit ff9feaacec
6 changed files with 251 additions and 37 deletions

19
web_server/utils/utils.py Normal file
View 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