Status API view
This commit is contained in:
parent
8cbe5d5944
commit
78e0d06566
2 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from api.views import AvailabilityView
|
from api.views import AvailabilityView, StatusView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('availability/', AvailabilityView.as_view(), name="availability")
|
path('availability/', AvailabilityView.as_view(), name="availability"),
|
||||||
|
path('status/', AvailabilityView.as_view(), name="status"),
|
||||||
]
|
]
|
|
@ -6,4 +6,8 @@ from buyer.models import Card
|
||||||
class AvailabilityView(View):
|
class AvailabilityView(View):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
cards = len(Card.objects.filter(delivered__isnull=True))
|
cards = len(Card.objects.filter(delivered__isnull=True))
|
||||||
return JsonResponse({"cards": cards})
|
return JsonResponse({"cards": cards})
|
||||||
|
|
||||||
|
class StatusView(View):
|
||||||
|
def get(self, request):
|
||||||
|
return JsonResponse({"status": "OK", "messages": []})
|
Loading…
Reference in a new issue