backend/inventory/urls.py
2025-03-23 21:24:08 +10:00

35 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
NomenclatureViewSet,
StickerViewSet,
StickerMovementViewSet,
ExternalNomenclatureView,
)
from .views_transfer import StickerTransferRequestViewSet # Импортируем новый ViewSet
router = DefaultRouter()
router.register(r'nomenclature', NomenclatureViewSet)
router.register(r'stickers', StickerViewSet)
router.register(r'movement', StickerMovementViewSet)
router.register(r'transfers', StickerTransferRequestViewSet, basename='stickertransfer') # Добавляем
urlpatterns = [
path('api/', include(router.urls)),
path('api/external-nomenclature/', ExternalNomenclatureView.as_view(), name="external-nomenclature"),
]
"""Трансфер передачи стикеров"""
"""{
"to_user": 3, // <-- ID пользователя, а не имя!
"items": [
{
"sticker": 12, // ID стикера
"quantity": 10
},
{
"sticker": 15,
"quantity": 5
}
]
}
"""