Messin with some other stuff

This commit is contained in:
iamBadgers
2026-04-09 18:36:51 -07:00
parent 917870128d
commit 69241d1c43
2 changed files with 27 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import sqlite3
from game_tables import GameService, GameTable
from key_tables import KeyService, KeyTable
import container_managment
from database import SmartCursor
app = Flask(__name__)
@@ -48,6 +49,28 @@ def get_tables():
return jsonify([table.toJson() for table in tables])
@app.route("/api/tables", methods=["POST"])
def create_table():
app.logger.info(request.get_json())
app.logger.info(request.get_json()["table_name"])
db = get_db()
with SmartCursor(connection=db) as smartCursor:
table = GameTable(
game_table_id=0,
game_table_name=request.get_json()["table_name"],
game_table_link=request.get_json()["table_link"],
active=False,
docker_id=None,
)
app.logger.info(table._created)
app.logger.info(table._updated)
table.commit(smartCursor)
app.logger.info(table._created)
app.logger.info(table._updated)
db.commit()
return jsonify({}), 200
@app.route("/api/tables/<table_id>")
def get_table(table_id):
gameService = GameService(get_db())