diff --git a/backend/app/urls.py b/backend/app/urls.py index b5e5178..933c809 100644 --- a/backend/app/urls.py +++ b/backend/app/urls.py @@ -1,7 +1,8 @@ from django.urls import path -from app.views import BhavCopyEquityView, BhavCopyEquityDefaultRedisView +from app.views import BhavCopyEquityView, BhavCopyEquityDefaultRedisView, EmptyRespoinseView urlpatterns = [ + path('emptyresponse/', EmptyRespoinseView.as_view(), name='emptyresponse_view'), path('bhavcopyequity/', BhavCopyEquityView.as_view(), name='bhavcopyequity_view'), - path('bhavcopyequitydefaultredis/', BhavCopyEquityDefaultRedisView.as_view(), name='bhavcopyequity_view'), + path('bhavcopyequitydefaultredis/', BhavCopyEquityDefaultRedisView.as_view(), name='bhavcopyequitydefaultredis_view'), ] diff --git a/backend/app/views.py b/backend/app/views.py index 07cdb83..9380f99 100644 --- a/backend/app/views.py +++ b/backend/app/views.py @@ -30,3 +30,9 @@ class BhavCopyEquityDefaultRedisView(generics.RetrieveAPIView): serializer = BhavCopyEquitySerializer(queryset, many=True) return Response(serializer.data) + +class EmptyRespoinseView(generics.RetrieveAPIView): + def get(self, request, *args, **kwargs): + return Response([]) + + diff --git a/frontend/src/views/BhavCopy.vue b/frontend/src/views/BhavCopy.vue index 187d01d..64bdd7d 100644 --- a/frontend/src/views/BhavCopy.vue +++ b/frontend/src/views/BhavCopy.vue @@ -75,8 +75,9 @@ link.click(); }, populateApiData() { - console.log(`Fetching data from ${this.apiEndpointSelected.endpoint} API`) - getAPI.get(`/${this.apiEndpointSelected.endpoint}/`,) + var endpoint = this.apiEndpointSelected.endpoint; + console.log(`Fetching data from ${endpoint} API`) + getAPI.get(`/${endpoint}/`,) .then(response => { console.log('BhavCopyEquity API has recieved data') this.apiData = response.data @@ -97,6 +98,7 @@ apiData: [], apiEndpointSelected: { endpoint: 'bhavcopyequity', text: "Plain Endpoint" }, apiEndpoints: [ + { endpoint: 'emptyresponse', text: "Empty Response Endpoint" }, { endpoint: 'bhavcopyequity', text: "Plain Endpoint" }, { endpoint: 'bhavcopyequitydefaultredis', text: "Default Redis Cache" } ],