From d5d029cd2f1fe2aa1d7560ba464852fc37f3b821 Mon Sep 17 00:00:00 2001 From: Dana Lambert Date: Tue, 9 Nov 2021 15:16:17 +1300 Subject: [PATCH] Review fixes - Remove redundant print statements - Update endpoint for csv download --- backend/right_tree/api/csv_utils.py | 5 +---- backend/right_tree/urls.py | 2 +- frontend/src/repository/PlantRepository.js | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/right_tree/api/csv_utils.py b/backend/right_tree/api/csv_utils.py index 266be6a..fbf3575 100644 --- a/backend/right_tree/api/csv_utils.py +++ b/backend/right_tree/api/csv_utils.py @@ -24,10 +24,7 @@ def get_location_filters(request): coordinates = request.query_params.get('coordinates') if coordinates is not None: - print('coords not none') - eco_district_layer = ecological_district_coordinate_filter( - coordinates).first() - print(eco_district_layer) + eco_district_layer = ecological_district_coordinate_filter(coordinates).first() point = get_point_from_coordinates(coordinates) filter_rows.append(['Point coordinates:', point]) diff --git a/backend/right_tree/urls.py b/backend/right_tree/urls.py index 1c421ba..995313d 100644 --- a/backend/right_tree/urls.py +++ b/backend/right_tree/urls.py @@ -26,7 +26,7 @@ router.register(r'ecologicaldistrict', views.EcologicalDistrictViewSet, basename router.register(r'address', views.LINZPropertyViewSet, basename='address') router.register(r'habitats', views.HabitatViewSet, basename='habitats') router.register(r'habitatimage', views.HabitatImageViewSet,basename='habitatimage') -router.register(r'downloadcsv', views.CSVDownloadView ,basename='downloadcsv') +router.register(r'download/csv', views.CSVDownloadView ,basename='downloadcsv') urlpatterns = [ path('admin/', admin.site.urls), diff --git a/frontend/src/repository/PlantRepository.js b/frontend/src/repository/PlantRepository.js index 17ee954..4772e54 100644 --- a/frontend/src/repository/PlantRepository.js +++ b/frontend/src/repository/PlantRepository.js @@ -7,7 +7,7 @@ const PlantRepository = { }, getPlantsCSV(filters) { - return Repository.get('/downloadcsv/', { params: filters }) + return Repository.get('/download/csv/', { params: filters }) } }