diff --git a/backend/api/urls.py b/backend/api/urls.py index eb965703..f9157b88 100644 --- a/backend/api/urls.py +++ b/backend/api/urls.py @@ -1,10 +1,8 @@ from django.urls import path -from api.views import hello_world from users.views import LoginView, RegisterUser urlpatterns = [ - path("hello_word", hello_world), path("create-user/", RegisterUser, name="create-user"), path("login/", LoginView, name="login"), ] diff --git a/backend/api/views.py b/backend/api/views.py index 55c4a2f9..e79ddc06 100644 --- a/backend/api/views.py +++ b/backend/api/views.py @@ -5,28 +5,3 @@ # Define your expected request body as a serializer from rest_framework import serializers - - -class HelloWorldSerializer(serializers.Serializer): - name = serializers.CharField( - required=True, help_text="Name of the person to greet." - ) - - -@swagger_auto_schema( - method="post", - request_body=HelloWorldSerializer, - operation_description="Post a name and receive a 'Hello' greeting in return.", -) -@api_view(["POST"]) -def hello_world(request): - """ - POST: - Receive a name in the request body and return a greeting. - """ - serializer = HelloWorldSerializer(data=request.data) - if serializer.is_valid(): - name = serializer.validated_data.get("name") - return Response(f"Hello {name}") - else: - return Response(serializer.errors, status=400)