Fakultas Ilmu Komputer UI

Commit 357d4bcf authored by Christopher Samuel's avatar Christopher Samuel
Browse files

[CHORES] Add default query for search kegiatan

parent 5adbfdaa
Pipeline #79719 passed with stages
in 21 minutes and 26 seconds
......@@ -39,6 +39,9 @@ urlpatterns = [
path('lokasi/kegiatan-terdekat',
views_kegiatan.nearest_kegiatan, name='nearest-kegiatan'),
path('lokasi/search-kegiatan',
views_kegiatan.search_kegiatan, name='search-kegiatan'),
path('lokasi/search-kegiatan/<str:query>',
views_kegiatan.search_kegiatan, name='search-kegiatan'),
......
......@@ -98,7 +98,7 @@ def list_foto_kegiatan(request, place_id, kegiatan_id):
@api_view(['GET'])
@authentication_classes([])
@permission_classes([])
def search_kegiatan(request, query):
def search_kegiatan(request, query=''):
query_by_nama = Kegiatan.objects.filter(nama_kegiatan__icontains=query)
query_by_deskripsi = Kegiatan.objects.filter(deskripsi__icontains=query)
query_by_penyelenggara = Kegiatan.objects.filter(penyelenggara__icontains=query)
......
Supports Markdown
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