added autocomplete to backend

This commit is contained in:
Jonas Winkler
2020-10-27 17:07:13 +01:00
parent f978703105
commit 6011c82531
3 changed files with 41 additions and 1 deletions

View File

@@ -11,7 +11,8 @@ from documents.views import (
TagViewSet,
DocumentTypeViewSet,
SearchView,
IndexView
IndexView,
SearchAutoCompleteView
)
api_router = DefaultRouter()
@@ -26,6 +27,7 @@ urlpatterns = [
# API
url(r"^api/auth/",include(('rest_framework.urls', 'rest_framework'), namespace="rest_framework")),
url(r"^api/search/autocomplete/", SearchAutoCompleteView.as_view(), name="autocomplete"),
url(r"^api/search/", SearchView.as_view(), name="search"),
url(r"^api/token/", views.obtain_auth_token), url(r"^api/", include((api_router.urls, 'drf'), namespace="drf")),