From 2e2be80193a4c0435273b3e9a0e010c60925d1b7 Mon Sep 17 00:00:00 2001 From: Leandro de Souza Date: Thu, 9 Nov 2023 16:54:53 -0300 Subject: [PATCH] Fix (api): Allows public access to the api endpoints --- src/api/urls.py | 10 +++------- src/api/v1/push_notifications/schemas.py | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/api/urls.py b/src/api/urls.py index fb0f492..2f9b58d 100644 --- a/src/api/urls.py +++ b/src/api/urls.py @@ -4,14 +4,10 @@ from . import v1 -schema_view = drf_views.SpectacularAPIView.as_view() -swagger_view = drf_views.SpectacularSwaggerView.as_view(url_name="schema") -redoc_view = drf_views.SpectacularRedocView.as_view(url_name="schema") - app_name = "api" urlpatterns = [ path("v1/", include((v1.urls, "api"), namespace="v1")), - path("schema/", auth_decorators.login_required(schema_view), name="schema"), - path("docs/", auth_decorators.login_required(swagger_view), name="docs"), - path("redoc/", auth_decorators.login_required(redoc_view), name="redoc"), + path("schema/", drf_views.SpectacularAPIView.as_view(), name="schema"), + path("docs/", drf_views.SpectacularSwaggerView.as_view(url_name="schema"), name="docs"), + path("redoc/", drf_views.SpectacularRedocView.as_view(url_name="schema"), name="redoc"), ] diff --git a/src/api/v1/push_notifications/schemas.py b/src/api/v1/push_notifications/schemas.py index 4f8a751..0714af2 100644 --- a/src/api/v1/push_notifications/schemas.py +++ b/src/api/v1/push_notifications/schemas.py @@ -25,7 +25,7 @@ class PushNotificationOutputSchema(serializers.ModelSerializer): "id": serializers.CharField(), "createdAt": serializers.DateTimeField(), "readAt": serializers.DateTimeField(), - "timeSinceCreated": serializers.DateTimeField(), + "timeSinceCreated": serializers.CharField(), "kind": serializers.CharField(), "meta": serializers.JSONField(), },