Skip to content

Commit

Permalink
fix: api_rest urls
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Oct 15, 2024
1 parent 03d3eed commit e3bb9b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions uniticket/api_rest/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from django.urls import path, re_path
from django.utils.text import slugify

from rest_framework import routers
from rest_framework.renderers import JSONOpenAPIRenderer
from rest_framework.schemas import get_schema_view

from api_rest.views import generic, manager, operator, user

from uni_ticket.settings import MANAGEMENT_URL_PREFIX


# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
Expand All @@ -27,7 +31,7 @@
path('api/ticket/close/<str:ticket_id>/', user.TicketAPIClose.as_view(), name='api-ticket-close'),

# manager
path('api/manager/<slug:structure_slug>/tickets/count/', manager.TicketAPICounter.as_view(), name='api-manager-tickets-count'),
path(f'api/{slugify(MANAGEMENT_URL_PREFIX["manager"])}/<slug:structure_slug>/tickets/count/', manager.TicketAPICounter.as_view(), name='api-manager-tickets-count'),

# operator
path('api/operatore/<slug:structure_slug>/tickets/count/', operator.TicketAPICounter.as_view(), name='api-operator-tickets-count'),]
path(f'api/{slugify(MANAGEMENT_URL_PREFIX["operator"])}/<slug:structure_slug>/tickets/count/', operator.TicketAPICounter.as_view(), name='api-operator-tickets-count'),]

0 comments on commit e3bb9b5

Please sign in to comment.