Commit 0ca36b89 authored by hypsug0's avatar hypsug0
Browse files

refactor: normalize place search API url

parent 2c58a800
......@@ -88,7 +88,7 @@ urlpatterns = [
path("place/<int:pk>/bridge/add", BridgeCreate.as_view(), name="bridge_create"),
path("bridge/<int:pk>/update", BridgeUpdate.as_view(), name="bridge_update"),
path("bridge/<int:pk>/delete", BridgeDelete.as_view(), name="bridge_delete"),
path("place/api/search", GeoJSONPlaces.as_view(), name="place_search_api"),
path("api/v1/place/search", GeoJSONPlaces.as_view(), name="place_search_api"),
path(
"place/bbox/api/search",
GeoJSONBBoxFilteredPlaces.as_view(),
......
......@@ -6,13 +6,13 @@ import datetime
import logging
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.gis.geos import Point
from django.core.files.storage import FileSystemStorage
from django.db import IntegrityError
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.shortcuts import redirect, reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, TemplateView
......@@ -312,7 +312,8 @@ class PlaceList(LoginRequiredMixin, TemplateView):
"js"
] = """
"""
context["dataUrl"] = "/place/api/search?format=json&"
url = reverse("sights:place_search_api")
context["dataUrl"] = f"{url}?format=json&"
return context
......@@ -328,7 +329,8 @@ class PlaceMyList(LoginRequiredMixin, TemplateView):
"js"
] = """
"""
context["dataUrl"] = f"/place/api/search?format=json&created_by_id={logged_user.id}&"
url = reverse("sights:place_search_api")
context["dataUrl"] = f"{url}?format=json&created_by_id={logged_user.id}&"
return context
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment