update endopoints

This commit is contained in:
ben
2026-08-17 14:52:44 +02:00
parent f43c32c72b
commit 80e46c09a3
2 changed files with 15 additions and 21 deletions
+14 -2
View File
@@ -133,8 +133,20 @@ def get_rooms(user_id):
)
return rooms
def delete_room(room_id):
room = execute(
"""
SELECT id
FROM rooms
WHERE id = ?
""",
(room_id,)
)
if not room:
return {"error": "room not found"}
execute(
"""
DELETE FROM rooms
@@ -143,7 +155,7 @@ def delete_room(room_id):
(room_id,)
)
return {"status":"deleted"}
return {"status": "deleted"}
def get_room(room_id, user_id):