cleaner api url definition

This commit is contained in:
Matthias 2021-11-27 21:41:49 +01:00
parent c4c43135f1
commit 2c9fc11349
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,7 @@ from build.urls import build_urls
from order.urls import order_urls
from barcodes.api import barcode_api_urls
from common.api import common_api_urls
from common.api import common_api_urls, settings_api_urls
from part.api import part_api_urls, bom_api_urls
from company.api import company_api_urls
from stock.api import stock_api_urls
@ -52,7 +52,7 @@ admin.site.site_header = "InvenTree Admin"
apipatterns = [
url(r'^barcode/', include(barcode_api_urls)),
url(r'^settings/', include(common_api_urls)),
url(r'^settings/', include(settings_api_urls)),
url(r'^part/', include(part_api_urls)),
url(r'^bom/', include(bom_api_urls)),
url(r'^company/', include(company_api_urls)),
@ -68,6 +68,9 @@ apipatterns = [
# Plugin endpoints
url(r'^action/', ActionPluginView.as_view(), name='api-action-plugin'),
# common endpoints
url(r'', include(common_api_urls)),
# InvenTree information endpoint
url(r'^$', InfoView.as_view(), name='api-inventree-info'),

View File

@ -144,6 +144,7 @@ class NotificationList(generics.ListAPIView):
#'age', # TODO enable ordering by age
'category',
'name',
'read',
]
search_fields = [
@ -181,8 +182,7 @@ class NotificationDetail(generics.RetrieveDestroyAPIView):
]
common_api_urls = [
settings_api_urls = [
# User settings
url(r'^user/', include([
# User Settings Detail
@ -200,6 +200,9 @@ common_api_urls = [
# Global Settings List
url(r'^.*$', GlobalSettingsList.as_view(), name='api-global-setting-list'),
])),
]
common_api_urls = [
# Notifications
url(r'^notifications/', include([