Skip to content

Commit

Permalink
froamt
Browse files Browse the repository at this point in the history
  • Loading branch information
libknt committed Jul 28, 2024
1 parent 2b7e974 commit 351fc16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pong/chat/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path
from .views import test, chat_room, room_status,rooms
from .views import test, chat_room, room_status, rooms

app_name = "chat"
urlpatterns = [
Expand Down
11 changes: 7 additions & 4 deletions pong/chat/views/rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

logger = getLogger(__name__)


def serialize_rooms(room):
return {"uuid": str(room.uuid), "name": room.name}


@jwt_exempt
@csrf_exempt
def search_rooms(request):
Expand All @@ -28,9 +30,9 @@ def search_rooms(request):
{"message": "Method is not allowed", "status": "invalidParams"},
status=400,
)
query = request.GET.get('query', '')
query = request.GET.get("query", "")
logger.info("search_rooms")

# if query:
# rooms = Rooms.objects.filter(name__icontains=query)
# else:
Expand All @@ -52,6 +54,7 @@ def search_rooms(request):
logger.error(e)
return JsonResponse({"message": e}, status=500)


def rooms(request):
try:
user = verify_user(request)
Expand All @@ -60,9 +63,9 @@ def rooms(request):
{"message": "Method is not allowed", "status": "invalidParams"},
status=400,
)
query = request.GET.get('query', '')
query = request.GET.get("query", "")
logger.info("search_rooms")

# if query:
# rooms = Rooms.objects.filter(name__icontains=query)
# else:
Expand Down

0 comments on commit 351fc16

Please sign in to comment.