Skip to content

Commit 51457c2

Browse files
committed
bugfix: fix routing
1 parent 3bfbfd6 commit 51457c2

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

candidates/urls.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from rest_framework.routers import DefaultRouter
33

44
from .views import (
5-
CandidateCreateView,
5+
CandidateCreateAPIView,
66
CandidateUserListView,
77
CandidateCompanyViewSet,
88
CandidateCompanyListView,

company/urls.py

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from django.urls import path
2-
from rest_framework.routers import DefaultRouter
32

43
from .views import (
54
CompanyPublicListAPIView,
@@ -9,20 +8,18 @@
98
CompanyCategoryListView,
109
)
1110

12-
router = DefaultRouter()
13-
router.register(
14-
"",
15-
CompanyPublicListAPIView,
16-
basename="company_public_list"
17-
)
18-
19-
router.register(
20-
"<slug:slug>",
21-
CompanyPublicRetrieveAPIView,
22-
basename="company_public_retrieve"
23-
)
2411

2512
urlpatterns = [
13+
path(
14+
"<str:slug>",
15+
CompanyPublicRetrieveAPIView.as_view(),
16+
name="company_public_retrieve"
17+
),
18+
path(
19+
"",
20+
CompanyPublicListAPIView.as_view(),
21+
name="company_public_list"
22+
),
2623
path(
2724
"company/",
2825
UserCompanyView.as_view(),
@@ -40,4 +37,3 @@
4037
),
4138
]
4239

43-
urlpatterns += router.urls

0 commit comments

Comments
 (0)